1
0
mirror of https://github.com/cmur2/dyndnsd.git synced 2024-12-22 00:54:22 +01:00

ci: use actionlint on GHA workflows

- https://github.com/rhysd/actionlint is cool
This commit is contained in:
cn 2022-02-15 23:56:09 +01:00 committed by Christian Nicolai
parent 2838ad9eae
commit dbc61d72fb
4 changed files with 31 additions and 3 deletions

17
.github/actionlint-matcher.json vendored Normal file
View File

@ -0,0 +1,17 @@
{
"problemMatcher": [
{
"owner": "actionlint",
"pattern": [
{
"regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$",
"file": 1,
"line": 2,
"column": 3,
"message": 4,
"code": 5
}
]
}
]
}

View File

@ -15,7 +15,7 @@ jobs:
- name: Extract dyndnsd version from tag name - name: Extract dyndnsd version from tag name
run: | run: |
echo "DYNDNSD_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV echo "DYNDNSD_VERSION=${GITHUB_REF#refs/*/v}" >> "$GITHUB_ENV"
- name: Wait for dyndnsd ${{ env.DYNDNSD_VERSION }} gem to be available - name: Wait for dyndnsd ${{ env.DYNDNSD_VERSION }} gem to be available
run: | run: |
@ -23,6 +23,7 @@ jobs:
for retry in $(seq 1 5); do for retry in $(seq 1 5); do
echo "Checking if dyndnsd $DYNDNSD_VERSION gem is retrievable from rubygems.org (try #$retry)..." echo "Checking if dyndnsd $DYNDNSD_VERSION gem is retrievable from rubygems.org (try #$retry)..."
sudo gem install dyndnsd -v "$DYNDNSD_VERSION" sudo gem install dyndnsd -v "$DYNDNSD_VERSION"
# shellcheck disable=SC2181
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
exit 0 exit 0
fi fi

View File

@ -33,3 +33,13 @@ jobs:
- name: Lint and Test - name: Lint and Test
run: | run: |
bundle exec rake ci bundle exec rake ci
actionlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check workflow files
run: |
echo "::add-matcher::.github/actionlint-matcher.json"
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
./actionlint

View File

@ -16,9 +16,9 @@ jobs:
steps: steps:
- name: Install Trivy - name: Install Trivy
run: | run: |
mkdir -p $GITHUB_WORKSPACE/bin mkdir -p "$GITHUB_WORKSPACE/bin"
echo "$GITHUB_WORKSPACE/bin" >> "$GITHUB_PATH" echo "$GITHUB_WORKSPACE/bin" >> "$GITHUB_PATH"
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/master/contrib/install.sh | sh -s -- -b $GITHUB_WORKSPACE/bin curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/master/contrib/install.sh | sh -s -- -b "$GITHUB_WORKSPACE/bin"
- name: Download Trivy DB - name: Download Trivy DB
run: | run: |
trivy image --download-db-only trivy image --download-db-only