Rotate certs #359
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Everything | |
on: | |
pull_request: | |
jobs: | |
test-job: | |
name: All Tests | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/setup-go@v2 | |
with: | |
go-version: '1.21.0' | |
id: go | |
- uses: actions/checkout@v2 | |
- uses: actions/cache@v2 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- uses: actions/github-script@v3 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const { data: labels } = await github.issues.listLabelsOnIssue({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: context.issue.number, | |
}); | |
const labelToRemove = 'tests-passed'; | |
const labelExists = labels.some(label => label.name === labelToRemove); | |
console.log("labelExists: ", labelExists); | |
if (labelExists) { | |
await github.issues.removeLabel({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
name: labelToRemove | |
}); | |
} | |
- name: Run Tests | |
run: | | |
echo "Git HEAD at: $(git rev-parse HEAD)" | |
./scripts/test || ./scripts/test || ./scripts/test | |
success-job: | |
needs: test-job | |
name: Add Label | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/github-script@v3 | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
github.issues.addLabels({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
labels: ['tests-passed'] | |
}) |