Skip to content

Rc comment with package links #12

Rc comment with package links

Rc comment with package links #12

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.RUBY_GEM_VERSION}}"
NPM_VERSION: '456'
NPM_LINK: "https://www.npmjs.com/package/playbook-ui/v/${{env.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:
AVAR: '789'
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "Here is the link ${{ env.AVAR }} to your Ruby Gem: ${{env.RUBY_GEM_VERSION}}"
})