Skip to content

Commit

Permalink
Merge pull request #2046 from moreal/ci/gh-actions/fix-workflow-syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
moreal authored Aug 1, 2023
2 parents 4a8bdfd + 7b2f617 commit 519ca3c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
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

0 comments on commit 519ca3c

Please sign in to comment.