-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
119 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,48 +15,48 @@ jobs: | |
env: | ||
TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
# Needed to specify token for checkout phase, only in push phase is too late | ||
# https://github.com/orgs/community/discussions/27072#discussioncomment-3254515 | ||
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
- name: debug logging for git remotes | ||
run: git remote -v | ||
- name: Normalize issue title | ||
id: normalizer | ||
env: | ||
ISSUE_TITLE: ${{ github.event.issue.title }} | ||
run: | | ||
title="$ISSUE_TITLE" | ||
title="${title//\[*\]/}" | ||
title=`echo $title | xargs` | ||
echo "title=${title// /-}" | tee -a "$GITHUB_OUTPUT" | ||
- name: setup go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: 'tool/go.mod' | ||
cache-dependency-path: 'tool/go.sum' | ||
- name: install articlegen | ||
run: | | ||
cd ./tool/articlegen | ||
go install . | ||
- name: install makepr | ||
run: | | ||
cd ./tool/makepr | ||
go install . | ||
- name: commit | ||
run: | | ||
GITHUB_TOKEN=${TOKEN} articlegen --issue-num=${{ github.event.issue.number }} > 'content/posts/${{ steps.normalizer.outputs.title }}.md' | ||
git config user.email "[email protected]" | ||
git config user.name "pankona" | ||
git switch '${{ steps.normalizer.outputs.title }}' || git switch -c '${{ steps.normalizer.outputs.title }}' | ||
git add 'content/posts/${{ steps.normalizer.outputs.title }}.md' | ||
git commit -m "add post ${{ steps.normalizer.outputs.title }}" | ||
- name: push | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
# "--force-with-lease" will not fit for upserting | ||
run: | | ||
pr_number="$(gh pr list --author "@me" --head '${{ steps.normalizer.outputs.title }}' --state open --json number --jq 'map(.number)[0]')" | ||
git push --set-upstream origin "${{ steps.normalizer.outputs.title }}" --force | ||
GITHUB_TOKEN=${TOKEN} makepr --base="main" --head='${{ steps.normalizer.outputs.title }}' --pr_number="${pr_number:=0}" --body="Resolves: ${{ github.event.issue.html_url }}" | ||
- uses: actions/checkout@v4 | ||
with: | ||
# Needed to specify token for checkout phase, only in push phase is too late | ||
# https://github.com/orgs/community/discussions/27072#discussioncomment-3254515 | ||
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
- name: debug logging for git remotes | ||
run: git remote -v | ||
- name: Normalize issue title | ||
id: normalizer | ||
env: | ||
ISSUE_TITLE: ${{ github.event.issue.title }} | ||
run: | | ||
title="$ISSUE_TITLE" | ||
title="${title//\[*\]/}" | ||
title=`echo $title | xargs` | ||
echo "title=${title// /-}" | tee -a "$GITHUB_OUTPUT" | ||
- name: setup go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: 'tool/go.mod' | ||
cache-dependency-path: 'tool/go.sum' | ||
- name: install articlegen | ||
run: | | ||
cd ./tool/articlegen | ||
go install . | ||
- name: install makepr | ||
run: | | ||
cd ./tool/makepr | ||
go install . | ||
- name: commit | ||
run: | | ||
GITHUB_TOKEN=${TOKEN} articlegen --issue-num=${{ github.event.issue.number }} > 'content/posts/${{ steps.normalizer.outputs.title }}.md' | ||
git config user.email "[email protected]" | ||
git config user.name "pankona" | ||
git switch '${{ steps.normalizer.outputs.title }}' || git switch -c '${{ steps.normalizer.outputs.title }}' | ||
git add 'content/posts/${{ steps.normalizer.outputs.title }}.md' | ||
git commit -m "add post ${{ steps.normalizer.outputs.title }}" | ||
- name: push | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
# "--force-with-lease" will not fit for upserting | ||
run: | | ||
pr_number="$(gh pr list --author "@me" --head '${{ steps.normalizer.outputs.title }}' --state open --json number --jq 'map(.number)[0]')" | ||
git push --set-upstream origin "${{ steps.normalizer.outputs.title }}" --force | ||
GITHUB_TOKEN=${TOKEN} makepr --base="main" --head='${{ steps.normalizer.outputs.title }}' --pr_number="${pr_number:=0}" --body="Resolves: ${{ github.event.issue.html_url }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters