Updates for tfc-agent release 1.15.2 #31
Workflow file for this run
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
# This workflow publishes a GitHub release when | |
# a branch with a particular pattern & version | |
# is merged. | |
# - ex. tfc-agent-release/1.2.6 | |
name: Publish Release on changelog branch merge | |
on: | |
pull_request: | |
types: | |
- closed | |
branches: | |
- main | |
paths: | |
- website/docs/cloud-docs/agents/changelog.mdx | |
env: | |
# the branch name of the PR | |
HEAD_REF: ${{ github.head_ref }} | |
jobs: | |
publish_release: | |
name: Publish Release | |
# only run if PR is merged | |
if: github.event.pull_request.merged == true | |
runs-on: ubuntu-latest | |
steps: | |
- name: Validate generated branch | |
run: | | |
if [[ $HEAD_REF =~ ^tfc-agent-release/[0-9]+\.[0-9]+\.[0-9]+$ ]] | |
then | |
echo "::notice::Branch is valid — $HEAD_REF" | |
else | |
echo "::error::Branch is invalid — $HEAD_REF" | |
exit 1 | |
fi | |
- name: Get version from branch name | |
run: | | |
version=${HEAD_REF#tfc-agent-release/} | |
echo "VERSION=$version" >> $GITHUB_ENV | |
- name: Checkout repository | |
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
- name: Publish release | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Prepend "v" | |
run: | | |
gh release create v${{env.VERSION}} --generate-notes | |
- name: Summary | |
run: | | |
echo "# Summary" >> $GITHUB_STEP_SUMMARY | |
echo "**Originating Branch**: $HEAD_REF" >> $GITHUB_STEP_SUMMARY | |
echo "**Version**: v${{env.VERSION}}" >> $GITHUB_STEP_SUMMARY |