-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implemented Pizza GitHub action (#1)
* feat: implemented Pizza GitHub action * stripping quotes from args from env vars * stripped quotes from args and bash script on the fly * chore: removed unnecessary JS files * added a commit and push script that optionally runs (false by default) * added a commit and push script that optionally runs (false by default) * removed bash script and inline git commit/push logic into action.yml * chore: added a comment about commit and push being optional * docs: added some docs around the GitHub action inputs * chore: updated GitHub marketplace icon * docs: added some docs around fetch depth 0
- Loading branch information
1 parent
0528b27
commit 84329a9
Showing
5 changed files
with
50 additions
and
369 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,55 @@ | ||
name: "OpenSauced Pizza Action" | ||
description: "GitHub Action to run OpenSauced's Pizza CLI's various commands" | ||
branding: | ||
icon: "image" | ||
icon: "package" | ||
color: "orange" | ||
inputs: | ||
github-token: | ||
description: "GitHub token" | ||
required: true | ||
pizza-args: | ||
description: "OpenSauced Pizza CLI command to run" | ||
default: "generate codeowners ./" | ||
required: true | ||
commit-and-push: | ||
description: "Commit and push changes" | ||
default: "false" | ||
required: false | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
- name: Setup Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
node-version: "20" | ||
go-version: "1.22.5" | ||
|
||
- name: Install pizza CLI | ||
run: | | ||
go install github.com/open-sauced/pizza-cli@beta | ||
shell: bash | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
- name: Check pizza CLI version | ||
run: pizza-cli version | ||
shell: bash | ||
working-directory: ${{ github.action_path }} | ||
|
||
- name: Install pizza-cli | ||
run: go install github.com/open-sauced/pizza-cli@latest | ||
- name: Run pizza CLI command | ||
run: | | ||
pwd | ||
ls -la | ||
pizza-cli ${{ inputs.pizza-args }} | ||
shell: bash | ||
working-directory: ${{ github.action_path }} | ||
working-directory: ${{ github.workspace }} | ||
|
||
- name: Run action | ||
run: node ${{ github.action_path }}/index.js | ||
- name: Commit and push changes | ||
if: ${{ inputs.commit-and-push == 'true' }} | ||
run: | | ||
git config user.name github-actions | ||
git config user.email github-actions@github.com | ||
git add . | ||
git commit -m "Auto-commit from GitHub Actions" | ||
git push | ||
shell: bash | ||
working-directory: ${{ github.action_path }} | ||
env: | ||
INPUT_GITHUB-TOKEN: ${{ inputs.github-token }} | ||
working-directory: ${{ github.workspace }} |
Oops, something went wrong.