Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(gh-actions): correct GitHub Actions workflow syntax #2046

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ name: main

on:
push:
branches: []
tags: []
branches:
- "*"
tags:
- "*"
pull_request:
branches: []
branches:
- "*"

jobs:
build-and-test:
Expand Down Expand Up @@ -84,13 +87,14 @@ jobs:
set -evx
curl -o /tmp/web-flow.gpg "$WEB_FLOW_KEY_URL"
gpg --import /tmp/web-flow.gpg
# shellcheck disable=SC2126
if ! git verify-commit "$GITHUB_REF_NAME" && \
[[ "$( git cat-file -p "$GITHUB_REF_NAME" \
| grep -Ei '^parent\s+[0-9a-f]{40}$' | wc -l )" -lt 2 ]]; then
echo "::error title=Invalid tag commit::Tags must refer to a merge" \
"commit or a commit signed by GitHub web-flow" \
"($WEB_FLOW_KEY_URL). The tag $GITHUB_REF_NAME refers to " \
"a commit $(git rev-parse $GITHUB_REF_NAME) which is neither" \
"a commit $(git rev-parse "$GITHUB_REF_NAME") which is neither" \
"a merge commit nor signed by GitHub web-flow."
exit 1
fi
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
project_suffix=dev.${{ github.sha }}
dotnet_args="$dotnet_args --version-suffix $project_suffix"
fi
dotnet build $dotnet_args
dotnet pack $dotnet_args
dotnet build "$dotnet_args"
dotnet pack "$dotnet_args"
- name: push
if: github.event_name != 'pull_request'
run: |
Expand Down Expand Up @@ -55,6 +55,6 @@ jobs:
working-directory: ./out
- name: Upload S3
run: aws s3 cp ${{ matrix.runtime }}.zip s3://9c-dx/lib9c-stateservices/${{ github.sha }}/
with:
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
18 changes: 18 additions & 0 deletions .github/workflows/validate-github-actions-workflows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: validate GitHub Actions workflows
on:
push:
paths:
- .github/workflows/*

pull_request:
paths:
- .github/workflows/*

jobs:
validate-github-actions-workflows:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
./actionlint
Loading