Skip to content

Commit

Permalink
Add preview text
Browse files Browse the repository at this point in the history
  • Loading branch information
wesley-dean-gsa committed Nov 19, 2024
1 parent d482844 commit 0d32178
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/preview_button.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
name: Preview Button

# yamllint disable-line rule:truthy
on:
pull_request:
workflow_dispatch:

permissions: read-all

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
pa11y:
runs-on: ubuntu-latest

permissions:
issues: write
pull-requests: write

steps:
- name: Setup custom variables
id: customvars
run: |
( echo -n "BASE_URL="
if [ -n "${{ vars.BASE_URL }}" ] ; then
echo "${{ vars.BASE_URL }}"
else
echo "https://federalist-a2423046-fe43-4e75-a2ef-2651e5e123ca.sites.pages.cloud.gov/preview/gsa-tts/tts.gsa.gov/"
fi
echo -n "URL_PATH="
if [ -n "${{ vars.URL_PATH }}" ] ; then
echo "${{ vars.URL_PATH }}/"
elif [ -n "${GITHUB_HEAD_REF:-}" ] ; then
echo "${GITHUB_HEAD_REF}/"
else
echo "staging/"
fi
) >> "$GITHUB_OUTPUT"
- name: Setup Button
id: button
run: echo "${{ steps.customvars.outputs.BASE_URL }}${{ steps.customvars.outputs.URL_PATH }}"

- name: Comment on pull request.
uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # pin@v2.5.0
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
message: "${{ steps.button.outputs.content }}"
comment_tag: button

0 comments on commit 0d32178

Please sign in to comment.