Skip to content

Bump actions/setup-go from 5 to 6 (#58) #73

Bump actions/setup-go from 5 to 6 (#58)

Bump actions/setup-go from 5 to 6 (#58) #73

Workflow file for this run

name: Test
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- run: go version
- name: Run unit tests
run: make test
integration:
name: Integration Tests
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout Code
uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- run: go version
- name: Build
run: make build
- name: Generate installation access token from PEM key file
run: |
printf "%s" "$APP_PRIVATE_KEY" > private_key.pem
./gh-token \
generate \
-i "$APP_ID" \
-k private_key.pem > /dev/null 2
env:
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
- name: List installations for the app from PEM key file
run: |
printf "%s" "$APP_PRIVATE_KEY" > private_key.pem
./gh-token \
installations \
-i "$APP_ID" \
-k private_key.pem > /dev/null 2
env:
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
- name: Generate installation access token with base64 key
run: |
./gh-token \
generate \
-i "$APP_ID" \
-b "$(echo "$APP_PRIVATE_KEY" | base64)" > /dev/null 2
env:
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
- name: List installations for the app with base64 key
run: |
./gh-token \
installations \
-i "$APP_ID" \
-b "$(echo "$APP_PRIVATE_KEY" | base64)" > /dev/null 2
env:
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
- name: Generate then revoke token
run: |
printf "%s" "$APP_PRIVATE_KEY" > private_key.pemm
token="$(./gh-token generate -i $APP_ID -k private_key.pem | jq -r '.token')"
./gh-token revoke -t $token
env:
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}