Skip to content

ci: check continuous release testing #22

ci: check continuous release testing

ci: check continuous release testing #22

# continuous-release.yml
name: Check release
on:
pull_request_target:
permissions:
contents: read
jobs:
check_release:
runs-on: ubuntu-latest
concurrency: release
permissions:
pull-requests: write
id-token: write
steps:
- name: Setup | Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- name: Setup | Checkout Repository at workflow sha
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
ref: ${{ github.sha }}
- name: Setup | Force correct release branch on workflow sha
run: |
git checkout -B ${{ github.ref_name }} ${{ github.sha }}
- name: Action | Semantic Version
id: check
# Adjust tag with desired version if applicable.
uses: python-semantic-release/python-semantic-release@c1bcfdbb994243ac7cf419365d5894d6bfb2950e # v9.12.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
build: false
changelog: true
commit: false
push: false
tag: false
vcs_release: false
- run: |
echo "## The results of python-semantic-release are below." | tee -a "$GITHUB_STEP_SUMMARY"
echo "* released: ${{ steps.check.outputs.released }}" | tee -a "$GITHUB_STEP_SUMMARY"
echo "* is_prerelease: ${{ steps.check.outputs.is_prerelease }}" | tee -a "$GITHUB_STEP_SUMMARY"
echo "* version: ${{ steps.check.outputs.version }}" | tee -a "$GITHUB_STEP_SUMMARY"
echo "* tag: ${{ steps.check.outputs.tag }}" | tee -a "$GITHUB_STEP_SUMMARY"
- name: Action | Comment on PR with new version
if: ${{ steps.check.outputs.released == 'true' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr comment ${{ github.event.pull_request.number }} --body "This PR will induce a release as v${{ steps.check.outputs.version }}\n"