Update actions/checkout action to v4 (#92) #19
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: release | |
on: | |
pull_request: | |
paths: | |
- .github/workflows/release.yaml | |
- .github/workflows/reusable--build.yaml | |
- Dockerfile | |
- hack/** | |
push: | |
branches: | |
- main | |
paths: | |
- .github/workflows/release.yaml | |
- .github/workflows/reusable--build.yaml | |
- Dockerfile | |
- hack/** | |
jobs: | |
# When the runner version is updated by Renovate, | |
# create a new release. | |
create-release-if-not-exists: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 | |
- run: bash hack/create-release-if-not-exists.sh | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Since GITHUB_TOKEN does not trigger the workflow, | |
# we need to manually build a new release. | |
get-latest-release: | |
if: github.event_name == 'push' | |
needs: create-release-if-not-exists | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
outputs: | |
tag: ${{ steps.latest-release.outputs.tag }} | |
steps: | |
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 | |
- run: echo "tag=$(gh release view --json tagName --jq .tagName)" >> "$GITHUB_OUTPUT" | |
id: latest-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build-latest-release: | |
needs: get-latest-release | |
uses: ./.github/workflows/reusable--build.yaml | |
with: | |
context: https://github.com/${{ github.repository }}.git#${{ needs.get-latest-release.outputs.tag }} | |
tags: ${{ needs.get-latest-release.outputs.tag }} |