Regenerate from api-reference v2.26.2 (patch -> 2.0.2) (#48) #8
This file contains hidden or 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: Tag on merge | |
| # Merging is what creates the version tag, and the tag is what publishes (FR-007f, FR-019a). | |
| # A breaking release waits for a human to merge, which is how the FR-019 approval is expressed. | |
| on: | |
| push: | |
| branches: [master, main] | |
| permissions: | |
| contents: write | |
| jobs: | |
| tag: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # SDK_RELEASE_TOKEN, not the automatic GITHUB_TOKEN. GitHub does not start a workflow run for | |
| # an event created with GITHUB_TOKEN, so a tag pushed with it would never trigger release.yml | |
| # and nothing would ever publish. That failure is silent: the tag appears, the release | |
| # workflow simply never runs. Needs contents:write on this repository. | |
| # Checked before checkout. An empty token there surfaces as a bare "Input required and not | |
| # supplied: token", which says nothing about which secret is missing or why it matters. | |
| - name: SDK_RELEASE_TOKEN must be set | |
| run: | | |
| test -n "${{ secrets.SDK_RELEASE_TOKEN }}" || { | |
| echo "SDK_RELEASE_TOKEN is not set on this repository." | |
| echo | |
| echo "The tag has to be pushed with it rather than the automatic GITHUB_TOKEN, because" | |
| echo "GitHub does not start a workflow run for an event created with that token. The" | |
| echo "tag would appear and release.yml would never fire, publishing nothing." | |
| exit 1 | |
| } | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.SDK_RELEASE_TOKEN }} | |
| - name: Tag the version if it is new | |
| run: | | |
| # v-prefixed, matching every tag this repository and api-reference already carry. | |
| # The version inside the package stays bare; only the git tag is prefixed. | |
| VERSION="v$(cat VERSION)" | |
| if git rev-parse "$VERSION" >/dev/null 2>&1; then | |
| echo "Tag $VERSION already exists, nothing to do." | |
| exit 0 | |
| fi | |
| git config user.name "Flat SDK bot" | |
| git config user.email "developers@flat.io" | |
| git tag -a "$VERSION" -m "Release $VERSION" | |
| git push origin "$VERSION" |