passage #8
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: passage | |
on: | |
schedule: | |
- cron: "47 3 * * *" | |
push: | |
branches: | |
- main | |
paths: | |
- .github/workflows/passage.yml | |
workflow_dispatch: | |
concurrency: | |
group: passage | |
jobs: | |
fetch: | |
name: Fetch | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Fetch | |
id: fetch | |
run: | | |
git clone https://github.com/FiloSottile/passage | |
cd passage | |
VERSION="$(git rev-list --count --all)" | |
if test -z "${VERSION}"; then | |
echo "Failed to count commits" | |
exit 1 | |
fi | |
COMMIT="$(git rev-parse --short HEAD)" | |
if test -z "${COMMIT}"; then | |
echo "Failed to get short commit hash" | |
exit 1 | |
fi | |
echo "Got version <${VERSION}.${COMMIT}>" | |
echo "version=${VERSION}.${COMMIT}" >>${GITHUB_OUTPUT} | |
- name: Release | |
uses: ncipollo/release-action@v1 | |
with: | |
token: ${{ secrets.BOT_GITHUB_TOKEN }} | |
allowUpdates: true | |
name: "passage v${{ steps.fetch.outputs.version }}" | |
tag: passage/${{ steps.fetch.outputs.version }} | |
draft: false | |
prerelease: false |