Skip to content

Commit

Permalink
Merge pull request #5195 from camptocamp/add-message-pr-5
Browse files Browse the repository at this point in the history
Add message on pull requests with the related examples
  • Loading branch information
sbrunner committed Oct 2, 2019
2 parents fce0ff4 + bb7c6a9 commit 2d0a056
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/test_url.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Add message on pull requests with the related examples

on:
pull_request:
types:
- opened

jobs:
all:
runs-on: ubuntu-latest
steps:
- run: npm install --production @actions/github
- run: |
echo "
const github = require('@actions/github');
async function run() {
// Get client and context
const client = new github.GitHub(process.env.GITHUB_TOKEN);
await client.pulls.createReview({
owner: github.context.issue.owner,
repo: github.context.issue.repo,
pull_number: github.context.issue.number,
body: [
\`Examples: https://camptocamp.github.io/ngeo/\${process.env.GITHUB_HEAD_REF}/examples/\`,
\`API documentation: https://camptocamp.github.io/ngeo/\${process.env.GITHUB_HEAD_REF}/apidoc/\`,
].join('\n'),
event: 'COMMENT'
});
}
run();
" > pr-message.js
- run: node pr-message.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 2d0a056

Please sign in to comment.