mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-25 00:33:41 -04:00
comment out
This commit is contained in:
140
.github/workflows/adr-accepted.yml
vendored
140
.github/workflows/adr-accepted.yml
vendored
@@ -1,83 +1,83 @@
|
|||||||
name: ADR accepted
|
# name: ADR accepted
|
||||||
|
|
||||||
on:
|
# on:
|
||||||
issues:
|
# issues:
|
||||||
types:
|
# types:
|
||||||
- closed
|
# - closed
|
||||||
|
|
||||||
permissions:
|
# permissions:
|
||||||
contents: read
|
# contents: read
|
||||||
|
|
||||||
jobs:
|
# jobs:
|
||||||
accept:
|
# accept:
|
||||||
runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
steps:
|
# steps:
|
||||||
|
|
||||||
- name: check for tags
|
# - name: check for tags
|
||||||
if: "${{ !contains(github.event.issue.labels.*.name, 'ADR: accepted' )}}"
|
# if: "${{ !contains(github.event.issue.labels.*.name, 'ADR: accepted' )}}"
|
||||||
shell: bash
|
# shell: bash
|
||||||
run: exit 0
|
# run: exit 0
|
||||||
|
|
||||||
- name: checkout main branch
|
# - name: checkout main branch
|
||||||
uses: actions/checkout@v6
|
# uses: actions/checkout@v6
|
||||||
with:
|
# with:
|
||||||
ref: main
|
# ref: main
|
||||||
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
# ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
|
||||||
- name: get ADR number
|
# - name: get ADR number
|
||||||
id: next
|
# id: next
|
||||||
shell: bash
|
# shell: bash
|
||||||
run: |
|
# run: |
|
||||||
mkdir -p docs/adrs
|
# mkdir -p docs/adrs
|
||||||
LAST_ADR=$(ls docs/adrs/*.md | grep -Eo "/[0-9]+-" | sort | tail -n1 | grep -Eo "[0-9]+")
|
# LAST_ADR=$(ls docs/adrs/*.md | grep -Eo "/[0-9]+-" | sort | tail -n1 | grep -Eo "[0-9]+")
|
||||||
LAST_ADR=$(echo "$LAST_ADR" | sed -E 's/^0+//')
|
# LAST_ADR=$(echo "$LAST_ADR" | sed -E 's/^0+//')
|
||||||
NEXT_ADR=$(($LAST_ADR + 1))
|
# NEXT_ADR=$(($LAST_ADR + 1))
|
||||||
NEXT_ADR=$(printf "%04i" "$NEXT_ADR")
|
# NEXT_ADR=$(printf "%04i" "$NEXT_ADR")
|
||||||
echo "number=$NEXT_ADR" >> "$GITHUB_OUTPUT"
|
# echo "number=$NEXT_ADR" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: get date
|
# - name: get date
|
||||||
id: date
|
# id: date
|
||||||
shell: bash
|
# shell: bash
|
||||||
run: echo "date=$(date +'%B %d, %Y')" >> "$GITHUB_OUTPUT"
|
# run: echo "date=$(date +'%B %d, %Y')" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: build filename
|
# - name: build filename
|
||||||
id: filename
|
# id: filename
|
||||||
shell: bash
|
# shell: bash
|
||||||
run: |
|
# run: |
|
||||||
SLUG=$(printf '%q\n' "${{ github.event.issue.title }}" | tr A-Z a-z)
|
# SLUG=$(printf '%q\n' "${{ github.event.issue.title }}" | tr A-Z a-z)
|
||||||
SLUG=$(printf '%q\n' "$SLUG" | iconv -c -t ascii//TRANSLIT)
|
# SLUG=$(printf '%q\n' "$SLUG" | iconv -c -t ascii//TRANSLIT)
|
||||||
SLUG=$(printf '%q\n' "$SLUG" | sed -E 's/[^a-z0-9]+/-/g' | sed -E 's/-+/-/g' | sed -E 's/^-+|-+$//g')
|
# SLUG=$(printf '%q\n' "$SLUG" | sed -E 's/[^a-z0-9]+/-/g' | sed -E 's/-+/-/g' | sed -E 's/^-+|-+$//g')
|
||||||
|
|
||||||
FILENAME="docs/adrs/${{ steps.next.outputs.number }}-$SLUG.md"
|
# FILENAME="docs/adrs/${{ steps.next.outputs.number }}-$SLUG.md"
|
||||||
echo "slug=$SLUG" >> "$GITHUB_OUTPUT"
|
# echo "slug=$SLUG" >> "$GITHUB_OUTPUT"
|
||||||
echo "filename=$FILENAME" >> "$GITHUB_OUTPUT"
|
# echo "filename=$FILENAME" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: write the ADR
|
# - name: write the ADR
|
||||||
uses: DamianReeves/write-file-action@v1.3
|
# uses: DamianReeves/write-file-action@v1.3
|
||||||
with:
|
# with:
|
||||||
path: ${{ steps.filename.outputs.filename }}
|
# path: ${{ steps.filename.outputs.filename }}
|
||||||
write-mode: overwrite
|
# write-mode: overwrite
|
||||||
contents: |
|
# contents: |
|
||||||
# ${{ github.event.issue.title }}
|
# # ${{ github.event.issue.title }}
|
||||||
|
|
||||||
Status: Accepted
|
# Status: Accepted
|
||||||
Date: ${{ steps.date.outputs.date }}
|
# Date: ${{ steps.date.outputs.date }}
|
||||||
|
|
||||||
${{ github.event.issue.body }}
|
# ${{ github.event.issue.body }}
|
||||||
|
|
||||||
- name: branch, commit, and open PR
|
# - name: branch, commit, and open PR
|
||||||
shell: bash
|
# shell: bash
|
||||||
env:
|
# env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
# run: |
|
||||||
BRANCH="adr/auto/${{ steps.filename.outputs.slug }}"
|
# BRANCH="adr/auto/${{ steps.filename.outputs.slug }}"
|
||||||
git config --global user.email "tts@gsa.gov"
|
# git config --global user.email "tts@gsa.gov"
|
||||||
git config --global user.name "Notify ADR Automation"
|
# git config --global user.name "Notify ADR Automation"
|
||||||
git checkout -b $BRANCH
|
# git checkout -b $BRANCH
|
||||||
git add docs/adrs/*.md
|
# git add docs/adrs/*.md
|
||||||
git commit -m "add ADR ${{ steps.next.outputs.number }}: ${{ github.event.issue.title }}"
|
# git commit -m "add ADR ${{ steps.next.outputs.number }}: ${{ github.event.issue.title }}"
|
||||||
git push -f origin $BRANCH
|
# git push -f origin $BRANCH
|
||||||
gh pr create \
|
# gh pr create \
|
||||||
--title "Add ADR ${{ steps.next.outputs.number }} to the repo" \
|
# --title "Add ADR ${{ steps.next.outputs.number }} to the repo" \
|
||||||
--body "This pull request was opened automatically because #${{ github.event.issue.number }} was closed after being marked as an approved ADR. It contains a markdown file capturing the ADR body at the time the issue was closed. Please verify that the markdown is correct before merging!" || true
|
# --body "This pull request was opened automatically because #${{ github.event.issue.number }} was closed after being marked as an approved ADR. It contains a markdown file capturing the ADR body at the time the issue was closed. Please verify that the markdown is correct before merging!" || true
|
||||||
gh pr merge $BRANCH --auto --squash || true
|
# gh pr merge $BRANCH --auto --squash || true
|
||||||
|
|||||||
Reference in New Issue
Block a user