feat(SP-2457): using mirrored gitleaks container when possible (#163) #412
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-and-release-beta' | |
on: # rebuild any PRs and main branch changes | |
pull_request: | |
push: | |
branches: | |
- main | |
- 'releases/*' | |
jobs: | |
build: # make sure build/ci work properly | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set GitHub packages registry | |
run: | | |
npm config set '//npm.pkg.github.com/:_authToken' ${{ secrets.GITHUB_TOKEN }} | |
npm config set @typeform:registry https://npm.pkg.github.com/ | |
- uses: actions/checkout@v2 | |
- run: | | |
yarn install | |
- run: | | |
yarn run all | |
test: # make sure the action works on a clean machine without building | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Test all checks | |
uses: ./ | |
with: | |
githubToken: ${{ secrets.GITHUB_TOKEN }} | |
dockerUsername: ${{ secrets.GITLEAKS_DOCKER_USERNAME }} | |
dockerPassword: ${{ secrets.GITLEAKS_DOCKER_PASSWORD }} | |
- name: Test skipping checks | |
uses: ./ | |
with: | |
skipChecks: 'jira-linked,secrets-scan' | |
githubToken: ${{ secrets.GITHUB_TOKEN }} | |
dockerUsername: ${{ secrets.GITLEAKS_DOCKER_USERNAME }} | |
dockerPassword: ${{ secrets.GITLEAKS_DOCKER_PASSWORD }} | |
- name: Test enabling optional checks | |
uses: ./ | |
with: | |
enableChecks: 'required-typescript' | |
githubToken: ${{ secrets.GITHUB_TOKEN }} | |
release: # this releases in beta | |
needs: [build, test] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Semantic Release | |
id: semantic | |
uses: codfish/semantic-release-action@4e9fa8ec064813465dfeccac8ae70f1348fb5dec | |
with: | |
repository_url: https://github.com/Typeform/ci-standard-checks.git | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
- name: Update beta version tag | |
if: steps.semantic.outputs.new-release-published == 'true' | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Bender Bot Tf" | |
git tag -fa v${TAG}-beta -m "Update v${TAG}-beta tag" | |
git push origin v${TAG}-beta --force | |
env: | |
TAG: ${{ steps.semantic.outputs.release-major }} | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} |