-
Notifications
You must be signed in to change notification settings - Fork 16
38 lines (33 loc) · 1.36 KB
/
github-actions-comment-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Comment on Push better
on:
pull_request:
types: [opened, synchronize]
jobs:
comment:
runs-on: ubuntu-latest
steps:
- name: Leave PR comment
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUBY_GEM_VERSION: '123'
RUBY_GEM_LINK: https://rubygems.org/gems/playbook_ui/versions/${{env.new_ruby_version}}
NPM_VERSION: '456'
NPM_LINK: https://www.npmjs.com/package/playbook-ui/v/${{env.new_npm_version}}
run: |
curl -H "Authorization: token ${GITHUB_TOKEN}" \
-X POST \
-d '{"body": "Release Candidate Created \n\n Your RC for Ruby Gems is [${{env.RUBY_GEM_VERSION}}](${{env.RUBY_GEM_LINK}}) \n\n Your RC for NPM is [${{env.NPM_VERSION}}](${{env.NPM_LINK}}) "}' \
"https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments"
- name: comment-two
uses: actions/github-script@v7
env:
RUBY_GEM_LINK: ${{env.RUBY_GEM_LINK}}
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `Here is the link to your Ruby Gem: ${process.env.RUBY_GEM_LINK}`
})