Skip to content

Commit

Permalink
Merge pull request #350 from Homebrew/fix-actionlint
Browse files Browse the repository at this point in the history
workflows: fix actionlint errors
  • Loading branch information
carlocab authored Apr 14, 2023
2 parents 3599d8b + 9a3621b commit 60a902b
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/brew-script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
$stderr.puts "test"
- name: Test
run: test "$GITHUB_SHA" = "$(cat $HOMEBREW_FILENAME)"
run: test "$GITHUB_SHA" = "$(cat "$HOMEBREW_FILENAME")"
2 changes: 1 addition & 1 deletion .github/workflows/check-commit-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
PR: ${{github.event.pull_request.number}}
run: gh api -X DELETE repos/$GITHUB_REPOSITORY/issues/$PR/labels/enhancement
run: gh api -X DELETE "repos/$GITHUB_REPOSITORY/issues/$PR/labels/enhancement"
2 changes: 1 addition & 1 deletion .github/workflows/download-artifact-download.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
path: artifact

- name: Test
run: cat artifact/sha | grep $GITHUB_SHA
run: grep "$GITHUB_SHA" artifact/sha
2 changes: 1 addition & 1 deletion .github/workflows/download-artifact-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Dump
run: |
mkdir artifact
echo $GITHUB_SHA > artifact/sha
echo "$GITHUB_SHA" > artifact/sha
- name: Upload
uses: actions/upload-artifact@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/label-pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
PR: ${{github.event.pull_request.number}}
run: gh api -X DELETE repos/$GITHUB_REPOSITORY/issues/$PR/labels/wontfix
run: gh api -X DELETE "repos/$GITHUB_REPOSITORY/issues/$PR/labels/wontfix"

- name: Test YAML
uses: ./label-pull-requests/
Expand All @@ -47,4 +47,4 @@ jobs:
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
PR: ${{github.event.pull_request.number}}
run: gh api -X DELETE repos/$GITHUB_REPOSITORY/issues/$PR/labels/invalid
run: gh api -X DELETE "repos/$GITHUB_REPOSITORY/issues/$PR/labels/invalid"
28 changes: 17 additions & 11 deletions .github/workflows/setup-homebrew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
include:
- os: macos-latest
key: macos
- os: ubuntu-18.04
key: ubuntu-18
- os: ubuntu-20.04
key: ubuntu-20
- os: ubuntu-22.04
key: ubuntu-22
- os: ubuntu-22.04
Expand All @@ -35,18 +35,24 @@ jobs:
steps:
- name: Checkout
run: |
# Allow writing under linuxbrew user
orig_uid=$(ls -nd $GITHUB_WORKSPACE | awk 'NR==1 {print $3}')
sudo chown -R $(whoami) $GITHUB_WORKSPACE $HOME
if [ "$RUNNER_OS" = "Linux" ]
then
# Allow writing under linuxbrew user
orig_uid="$(stat --printf='%u' "$GITHUB_WORKSPACE")"
sudo chown -R "$(whoami)" "$GITHUB_WORKSPACE" "$HOME"
fi
git config --global --add safe.directory $GITHUB_WORKSPACE
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git init
git remote add origin $GITHUB_SERVER_URL/$GITHUB_REPOSITORY
git fetch --no-tags --depth=1 origin $GITHUB_SHA
git checkout --force $GITHUB_SHA
git remote add origin "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY"
git fetch --no-tags --depth=1 origin "$GITHUB_SHA"
git checkout --force "$GITHUB_SHA"
# Reset ownership so we test if the equivalent in setup-homebrew works.
sudo chown -R $orig_uid $GITHUB_WORKSPACE $HOME
if [ "$RUNNER_OS" = "Linux" ]
then
# Reset ownership so we test if the equivalent in setup-homebrew works.
sudo chown -R "$orig_uid" "$GITHUB_WORKSPACE" "$HOME"
fi
- name: Check syntax
run: bash -n setup-homebrew/*.sh
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/vendor-node-modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
gh pr checkout '${{ github.event.pull_request.number || github.event.inputs.pull_request }}'
branch="$(git branch --show-current)"
echo "branch=${branch}" >> $GITHUB_OUTPUT
echo "branch=${branch}" >> "$GITHUB_OUTPUT"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Vendor node_modules
Expand All @@ -57,7 +57,7 @@ jobs:
if ! git diff --stat --exit-code node_modules; then
git add node_modules
git commit -m "node_modules: update"
echo "committed=true" >> $GITHUB_OUTPUT
echo "committed=true" >> "$GITHUB_OUTPUT"
fi
- name: Push to pull request
if: steps.commit.outputs.committed == 'true'
Expand Down

0 comments on commit 60a902b

Please sign in to comment.