Skip to content

Commit

Permalink
Update a workflow file for GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
matsuo committed Sep 5, 2024
1 parent ffe7f07 commit abd6185
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ jobs:
shell: bash
run: echo "GOSS_USE_ALPHA=1" >> "$GITHUB_ENV"

- if: runner.os == 'Linux'
- if: runner.os == 'Linux' && (github.repository_owner == 'emic' || github.repository_owner == 'matsuo')
name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN_202507 }}

- if: runner.os == 'Linux'
- if: runner.os == 'Linux' && (github.repository_owner == 'emic' || github.repository_owner == 'matsuo')
name: Pull from GitHub Container Registry
run: |
docker pull --platform=linux/amd64 ghcr.io/matsuo/goss:latest
Expand All @@ -64,7 +64,7 @@ jobs:
cp ./release/goss-linux-arm64 /tmp/goss-linux-arm64
EOF
- if: runner.os == 'macOS'
- if: runner.os == 'macOS' || (runner.os == 'Linux' && !(github.repository_owner == 'emic' || github.repository_owner == 'matsuo'))
run: |
curl -L "https://github.com/goss-org/goss/archive/${{ env.goss_commit_hash }}.tar.gz" -o goss.tar.gz
tar xzvf goss.tar.gz
Expand All @@ -83,11 +83,15 @@ jobs:
mv goss-windows-amd64.exe release/
cd ..
- if: runner.os == 'Linux'
- if: runner.os == 'Linux' && (github.repository_owner == 'emic' || github.repository_owner == 'matsuo')
run: |
./goss-linux-amd64 --version
OS=linux ./goss-linux-amd64 --gossfile tests/goss.yaml validate --format documentation
- if: runner.os == 'Linux' && !(github.repository_owner == 'emic' || github.repository_owner == 'matsuo')
run: |
OS=linux "./goss-${{ env.goss_commit_hash }}/release/goss-linux-amd64" --gossfile tests/goss.yaml validate --format documentation
- if: runner.os == 'macOS'
run: |
OS=darwin "./goss-${{ env.goss_commit_hash }}/release/goss-darwin-amd64" --gossfile tests/goss.yaml validate --format documentation
Expand Down

0 comments on commit abd6185

Please sign in to comment.