name: discourse-release description: >- Announce a published Gitea release on the Coffey Labs community forum, in the repo's Announcements category (release-map.json). Safe to re-run: a release is announced at most once. inputs: api-key: description: release-bot's forum API key (scope topics:write only) required: true discord-webhook: description: optional Discord webhook URL; when set, the announcement is also posted there required: false default: "" tag: description: >- announce the release with this tag instead of the triggering release event. Needed in a workflow that creates its release with the job's own token: Gitea does not start workflows for events the Actions bot causes, so `on: release` never fires for those releases. required: false default: "" forum: description: forum base URL required: false default: https://community.coffeylabs.org runs: using: composite steps: - shell: sh env: API_KEY: ${{ inputs.api-key }} DISCORD_WEBHOOK: ${{ inputs.discord-webhook }} FORUM: ${{ inputs.forum }} REPO: ${{ github.repository }} EVENT_PATH: ${{ github.event_path }} TAG: ${{ inputs.tag }} GITEA_TOKEN: ${{ github.token }} ACTION_PATH: ${{ github.action_path }} MAP: ${{ github.action_path }}/release-map.json run: | set -eu # The job image may be bare; the script needs bash, curl and jq. if ! command -v curl >/dev/null || ! command -v jq >/dev/null || ! command -v bash >/dev/null; then if command -v apk >/dev/null; then apk add --no-cache -q bash curl jq ca-certificates >/dev/null else apt-get update -qq >/dev/null && apt-get install -y -qq --no-install-recommends bash curl jq ca-certificates >/dev/null; fi fi exec bash "$ACTION_PATH/announce.sh"