Skip to content

Commit

Permalink
chore: sync with status-page
Browse files Browse the repository at this point in the history
  • Loading branch information
steveoh committed Jul 15, 2024
1 parent f973b7b commit b72296f
Showing 1 changed file with 40 additions and 8 deletions.
48 changes: 40 additions & 8 deletions .github/workflows/issue_opened.new-blog-post.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ jobs:
open-pr:
runs-on: ubuntu-latest
steps:
- name: πŸ” Check issue type
run: |
if [[ "${{ github.event.issue.title }}" != "✍️ New blog post idea" ]]; then
echo "Issue title does not start with '✍️ New blog post idea', skipping"
exit 86
fi
- name: 🎬 Update status
id: update_status
uses: actions/github-script@v7
with:
script: |
const response = await github.rest.reactions.createForIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number,
content: 'eyes'
});
return response.data.id;
- name: πŸ”¬ Check actor
uses: tspascoal/get-user-teams-membership@v3
id: checkUserMember
Expand Down Expand Up @@ -44,14 +50,40 @@ jobs:

- name: πŸ“ Create Blog Post
working-directory: scripts
run: node new-blog.js ${{ github.event.issue.id }}
run: node new-blog.mjs ${{ github.event.issue.id }}

- name: πŸ“Œ Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'feat: create new blog post'
title: 'feat: create new blog post'
body: 'This PR was automatically created by the "New Issue" workflow.'
body: |
This PR was automatically created by the "Issue opened (new blog)" workflow.
closes #${{ github.event.issue.number}}
branch: feat/new-blog-post-${{ github.event.issue.number }}
draft: true

- name: πŸ—‘οΈ Remove reaction
uses: actions/github-script@v7
with:
script: |
github.rest.reactions.deleteForIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number,
reaction_id: ${{ steps.update_status.outputs.result }}
})
- name: βœ… Set complete reaction
uses: actions/github-script@v7
if: ${{ steps.cpr.outputs.pull-request-number }}
with:
script: |
github.rest.reactions.createForIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number,
content: 'rocket'
});

0 comments on commit b72296f

Please sign in to comment.