Skip to content

fix(addresses): reveal rendered addresses #118

fix(addresses): reveal rendered addresses

fix(addresses): reveal rendered addresses #118

# App Release PR Cancel — notifies Slack when a release PR is closed without merge.
name: App Release PR Cancel
on:
pull_request:
types: [closed]
branches: [main]
permissions:
contents: read
pull-requests: read
jobs:
notify:
if: github.event.pull_request.merged == false && startsWith(github.event.pull_request.head.ref, 'release/app/')
runs-on: ubuntu-latest
steps:
- name: Load secrets
id: secrets
uses: 1password/load-secrets-action@eb2efd0703da22a93c467f2d1ffbb6826c11e19c # v4.0.0 (https://github.com/1Password/load-secrets-action/releases/tag/v4.0.0)
with:
export-env: false
env:
OP_SERVICE_ACCOUNT_TOKEN: '${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}'
SLACK_BOT_TOKEN: op://kv_app_infra/SLACK_BOT_TOKEN/credential
SLACK_CHANNEL_ID: op://kv_app_infra/SLACK_CHANNEL_ID/credential
SLACK_CODEOWNERS_GROUP_ID: op://kv_app_infra/SLACK_CODEOWNERS_GROUP_ID/credential
LINEAR_PIPELINE_ACCESS_KEY: op://kv_app_infra/LINEAR_PIPELINE_ACCESS_KEY/credential
- name: Checkout
uses: actions/checkout@v7.0.1
with:
ref: ${{ github.event.pull_request.base.sha }}
fetch-depth: 1
sparse-checkout: |
.github/workflows/scripts/slackNotify.js
.github/actions/extract-slack-ts
.github/actions/gh-pr-get-body
.github/actions/slack-notify
- name: Read PR body
id: pr
uses: ./.github/actions/gh-pr-get-body
with:
pr_number: ${{ github.event.pull_request.number }}
token: ${{ github.token }}
- name: Extract Slack TS from PR body
id: ts
uses: ./.github/actions/extract-slack-ts
with:
body: ${{ steps.pr.outputs.body }}
- name: Extract version from PR title
id: version
run: |
VERSION=$(echo "${PR_TITLE}" | sed -nE 's#^Release (@aragon/app@[0-9]+\.[0-9]+\.[0-9]+).*$#\1#p')
echo "name=${VERSION}" >> "$GITHUB_OUTPUT"
env:
PR_TITLE: ${{ github.event.pull_request.title }}
- name: Linear — set stage to canceled
id: linear-cancel
if: steps.version.outputs.name != '' && steps.secrets.outputs.LINEAR_PIPELINE_ACCESS_KEY != ''
continue-on-error: true
uses: linear/linear-release-action@3f31fcf14c110cc53579fcc3575a26d469c413b4 # v0.17.1 (https://github.com/linear/linear-release-action/releases/tag/v0.17.1)
with:
access_key: ${{ steps.secrets.outputs.LINEAR_PIPELINE_ACCESS_KEY }}
command: update
version: ${{ steps.version.outputs.name }}
stage: canceled
- name: Notify Slack (cancelled)
if: steps.secrets.outputs.SLACK_BOT_TOKEN && steps.ts.outputs.ts
uses: ./.github/actions/slack-notify
with:
slack_bot_token: ${{ steps.secrets.outputs.SLACK_BOT_TOKEN }}
slack_channel_id: ${{ steps.secrets.outputs.SLACK_CHANNEL_ID }}
thread_ts: ${{ steps.ts.outputs.ts }}
message: |
🛑 *Release cancelled*${{ steps.linear-cancel.outcome == 'success' && ' — Linear release moved to Canceled stage' || '' }}
# Reflect the lifecycle status in the head message itself (chat.update).
# Re-uses the changelog from the PR body (minus the slack_ts marker) so the
# rich head is preserved while only the status line changes.
- name: Strip slack_ts marker from PR body (clean changelog)
id: changelog
env:
BODY: ${{ steps.pr.outputs.body }}
run: |
CLEAN="$(printf '%s' "$BODY" | sed '/<!-- slack_ts:/d')"
{
echo 'text<<CHANGELOG_EOF'
echo "$CLEAN"
echo 'CHANGELOG_EOF'
} >> "$GITHUB_OUTPUT"
- name: Update head message — Cancelled
if: steps.secrets.outputs.SLACK_BOT_TOKEN && steps.ts.outputs.ts
uses: ./.github/actions/slack-notify
with:
slack_bot_token: ${{ steps.secrets.outputs.SLACK_BOT_TOKEN }}
slack_channel_id: ${{ steps.secrets.outputs.SLACK_CHANNEL_ID }}
update_ts: ${{ steps.ts.outputs.ts }}
message: |
🛑 *Release ${{ steps.version.outputs.name || 'PR' }} — Cancelled* ${{ steps.secrets.outputs.SLACK_CODEOWNERS_GROUP_ID && format('<!subteam^{0}>', steps.secrets.outputs.SLACK_CODEOWNERS_GROUP_ID) || '' }}
*PR:* <${{ github.event.pull_request.html_url }}|${{ github.event.pull_request.title }}>
${{ steps.changelog.outputs.text }}