|
1 | | -<p align="center"> |
2 | | - <a href="https://github.com/AurorNZ/report-updated-dependencies/actions"><img alt="report-updated-dependencies status" src="https://github.com/AurorNZ/report-updated-dependencies/workflows/build-test/badge.svg"></a> |
3 | | -</p> |
4 | | - |
5 | | -# Report updated dependencies |
6 | | - |
7 | | -This Github Actions runs on changes to PR requests to detect and report changes made to dependencies. |
8 | | -Dependency lookups, change detections and fetching of release notes are all done by [Renovate Bot](https://github.com/renovatebot/renovate) |
9 | | - |
10 | | -```yml |
11 | | -name: 'build-test' |
12 | | -on: |
13 | | - pull_request: |
14 | | - |
15 | | -jobs: |
16 | | - report-updated-dependencies: |
17 | | - runs-on: ubuntu-latest |
18 | | - steps: |
19 | | - - uses: actions/checkout@v2 |
20 | | - - uses: AurorNZ/report-updated-dependencies@v1 |
21 | | -``` |
22 | | -
|
23 | | -or run conditionally |
24 | | -
|
25 | | -```yml |
26 | | -name: 'build-test' |
27 | | -on: # rebuild any PRs and main branch changes |
28 | | - pull_request: |
29 | | - push: |
30 | | - branches: |
31 | | - - main |
32 | | - - 'releases/*' |
33 | | - |
34 | | -jobs: |
35 | | - report-updated-dependencies: |
36 | | - if: ${{ github.event_name == 'pull_request' }} |
37 | | - runs-on: ubuntu-latest |
38 | | - steps: |
39 | | - - uses: actions/checkout@v2 |
40 | | - - uses: AurorNZ/report-updated-dependencies@v1 |
41 | | -``` |
42 | | -
|
43 | | -## Publish to a distribution branch |
44 | | -
|
45 | | -Actions are run from GitHub repos so we will checkin the packed dist folder. |
46 | | -
|
47 | | -Then run [ncc](https://github.com/zeit/ncc) and push the results: |
48 | | -
|
49 | | -```bash |
50 | | -$ npm run package |
51 | | -$ git add dist |
52 | | -$ git commit -a -m "prod dependencies" |
53 | | -$ git push origin releases/v1 |
54 | | -``` |
55 | | - |
56 | | -Note: We recommend using the `--license` option for ncc, which will create a license file for all of the production node modules used in your project. |
57 | | - |
58 | | -Your action is now published! :rocket: |
59 | | - |
60 | | -See the [versioning documentation](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md) |
| 1 | +<p align="center"> |
| 2 | + <a href="https://github.com/AurorNZ/report-updated-dependencies/actions"><img alt="report-updated-dependencies status" src="https://github.com/AurorNZ/report-updated-dependencies/workflows/build-test/badge.svg"></a> |
| 3 | +</p> |
| 4 | + |
| 5 | +# Report updated dependencies |
| 6 | + |
| 7 | +This Github Actions runs on changes to PR requests to detect and report changes made to dependencies. |
| 8 | +Dependency lookups, change detections and fetching of release notes are all done by [Renovate Bot](https://github.com/renovatebot/renovate) |
| 9 | + |
| 10 | +```yml |
| 11 | +name: 'build-test' |
| 12 | +on: |
| 13 | + pull_request: |
| 14 | + |
| 15 | +jobs: |
| 16 | + report-updated-dependencies: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v2 |
| 20 | + - uses: AurorNZ/report-updated-dependencies@v1 |
| 21 | +``` |
| 22 | +
|
| 23 | +or run conditionally |
| 24 | +
|
| 25 | +```yml |
| 26 | +name: 'build-test' |
| 27 | +on: # rebuild any PRs and main branch changes |
| 28 | + pull_request: |
| 29 | + push: |
| 30 | + branches: |
| 31 | + - main |
| 32 | + - 'releases/*' |
| 33 | + |
| 34 | +jobs: |
| 35 | + report-updated-dependencies: |
| 36 | + if: ${{ github.event_name == 'pull_request' }} |
| 37 | + runs-on: ubuntu-latest |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@v2 |
| 40 | + - uses: AurorNZ/report-updated-dependencies@v1 |
| 41 | +``` |
| 42 | +
|
| 43 | +## Publish to a distribution branch |
| 44 | +
|
| 45 | +Actions are run from GitHub repos so we will checkin the packed dist folder. |
| 46 | +
|
| 47 | +Then run [ncc](https://github.com/zeit/ncc) and push the results: |
| 48 | +
|
| 49 | +```bash |
| 50 | +$ npm run package |
| 51 | +$ git add dist |
| 52 | +$ git commit -a -m "prod dependencies" |
| 53 | +$ git push origin releases/v1 |
| 54 | +``` |
| 55 | + |
| 56 | +Note: We recommend using the `--license` option for ncc, which will create a license file for all of the production node modules used in your project. |
| 57 | + |
| 58 | +Your action is now published! :rocket: |
| 59 | + |
| 60 | +See the [versioning documentation](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md) |
| 61 | + |
| 62 | + |
| 63 | +## Debugging |
| 64 | +- Create a pull request, ideally with commits that update dependencies |
| 65 | +- Download the `github-context` artifact from Github Actions run for the PR. That artifact should have the JSON file with the context of the Github event. |
| 66 | +- Put the `event.json` file into the root of this repository |
| 67 | +- Add the following code to `.env` file |
| 68 | + ``` |
| 69 | + GITHUB_EVENT_NAME=pull_request |
| 70 | + GITHUB_EVENT_PATH=event.json |
| 71 | + INPUT_TOKEN=<YOUR_GITHUB_TOKEN> |
| 72 | + ``` |
| 73 | +- Hit F5 in VSCode to start debugging |
0 commit comments