Skip to content

ci: update readme automatically (#11) #8

ci: update readme automatically (#11)

ci: update readme automatically (#11) #8

name: Release Please
on:
push:
branches: [main]
permissions:
contents: write
pull-requests: write
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
id: release
with:
release-type: python
# Move major version tag (e.g. v1) after a release is cut
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
if: ${{ steps.release.outputs.release_created }}
with:
persist-credentials: false
- name: Tag major version
if: ${{ steps.release.outputs.release_created }}
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git"
git tag -fa "v${{ steps.release.outputs.major }}" \
-m "Release v${{ steps.release.outputs.tag_name }}"
git push origin "v${{ steps.release.outputs.major }}" --force
- name: Pin README to release SHA
if: ${{ steps.release.outputs.release_created }}
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
sed -i \
's|developmentseed/python-security-auditing@[^ ]*\( # v[0-9][^ ]*\)\?|developmentseed/python-security-auditing@${{ steps.release.outputs.sha }} # ${{ steps.release.outputs.tag_name }}|g' \
README.md
git add README.md
git diff --cached --quiet && echo "README unchanged, skipping commit" && exit 0
git commit -m "chore: pin README to ${{ steps.release.outputs.tag_name }} [skip ci]"
git push origin HEAD:main