Skip to content

manual

manual #576

Workflow file for this run

name: manual
on:
workflow_dispatch:
workflow_run:
workflows: ["build"]
types: [completed]
pull_request:
types:
- closed
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
defaults:
run:
# GitHub Actions run without a TTY device. This is a workaround to get one,
# based on https://github.com/actions/runner/issues/241#issuecomment-2019042651
shell: 'script --return --quiet --log-out /dev/null --command "bash -e {0}"'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_OWNER: ${{ github.repository_owner }}
GITHUB_REPO: ${{ github.event.repository.name }}
GITHUB_BRANCH: ${{ github.head_ref || github.ref_name }}
jobs:
update:
# sqlite3-pcre is last available on Ubuntu 23.04 as of 2024-10-11
runs-on: ubuntu-22.04
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Fetch latest data
run: |
pushd src || exit 1
source lib/util.sh
get_db
popd || exit 1
- name: Fetch all data
uses: robinraju/release-downloader@v1
with:
latest: true
fileName: "*.zst"
tarBall: false
zipBall: false
- name: Dry run
id: update
run: |
docker run -v $PWD:/app --env-file <(env | grep GITHUB) \
ghcr.io/$GITHUB_OWNER/$GITHUB_REPO:master \
bash src/test/update.sh; echo "updated=$?" >> "$GITHUB_OUTPUT"
- name: Get date
id: date
run: echo "tag=$(date -u +%-Y.%-m).$((($(date -u +%-d)-1)/7))" >> "$GITHUB_OUTPUT"
- name: Save database
if: ${{ steps.update.outputs.updated == '0' }}
uses: ncipollo/release-action@v1
with:
artifacts: "*.zst"
bodyFile: "CHANGELOG.md"
tag: "v${{ steps.date.outputs.tag }}"
commit: "master"
allowUpdates: true