generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Describe a way of debugging this action
- Loading branch information
Showing
4 changed files
with
124 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,47 @@ | ||
name: 'build-test' | ||
on: # rebuild any PRs and main branch changes | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- 'releases/*' | ||
|
||
jobs: | ||
build: # make sure build/ci work properly | ||
runs-on: ubuntu-latest | ||
steps: | ||
name: 'build-test' | ||
on: # rebuild any PRs and main branch changes | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- 'releases/*' | ||
|
||
jobs: | ||
build: # make sure build/ci work properly | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: | | ||
npm ci | ||
- run: | | ||
npm run all | ||
- name: Verify no unstaged changes | ||
run: __test__/verify-no-unstaged-changes.sh | ||
- run: | | ||
npm ci | ||
- run: | | ||
npm run all | ||
- name: Verify no unstaged changes | ||
run: __test__/verify-no-unstaged-changes.sh | ||
|
||
test: # make sure the action works on a clean machine without building | ||
runs-on: ubuntu-latest | ||
steps: | ||
test: # make sure the action works on a clean machine without building | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./ | ||
- uses: ./ | ||
|
||
dump-event: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: github-context | ||
path: ${{github.event_path}} | ||
|
||
pr-build-test: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event_name == 'pull_request' }} | ||
steps: | ||
pr-build-test: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event_name == 'pull_request' }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
with: | ||
node-version: '16' | ||
- run: | | ||
npm ci | ||
- run: | | ||
npm run build | ||
- uses: ./ | ||
- run: | | ||
npm ci | ||
- run: | | ||
npm run build | ||
- uses: ./ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,73 @@ | ||
<p align="center"> | ||
<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> | ||
</p> | ||
|
||
# Report updated dependencies | ||
|
||
This Github Actions runs on changes to PR requests to detect and report changes made to dependencies. | ||
Dependency lookups, change detections and fetching of release notes are all done by [Renovate Bot](https://github.com/renovatebot/renovate) | ||
|
||
```yml | ||
name: 'build-test' | ||
on: | ||
pull_request: | ||
|
||
jobs: | ||
report-updated-dependencies: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: AurorNZ/report-updated-dependencies@v1 | ||
``` | ||
or run conditionally | ||
```yml | ||
name: 'build-test' | ||
on: # rebuild any PRs and main branch changes | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- 'releases/*' | ||
|
||
jobs: | ||
report-updated-dependencies: | ||
if: ${{ github.event_name == 'pull_request' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: AurorNZ/report-updated-dependencies@v1 | ||
``` | ||
## Publish to a distribution branch | ||
Actions are run from GitHub repos so we will checkin the packed dist folder. | ||
Then run [ncc](https://github.com/zeit/ncc) and push the results: | ||
```bash | ||
$ npm run package | ||
$ git add dist | ||
$ git commit -a -m "prod dependencies" | ||
$ git push origin releases/v1 | ||
``` | ||
|
||
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. | ||
|
||
Your action is now published! :rocket: | ||
|
||
See the [versioning documentation](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md) | ||
<p align="center"> | ||
<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> | ||
</p> | ||
|
||
# Report updated dependencies | ||
|
||
This Github Actions runs on changes to PR requests to detect and report changes made to dependencies. | ||
Dependency lookups, change detections and fetching of release notes are all done by [Renovate Bot](https://github.com/renovatebot/renovate) | ||
|
||
```yml | ||
name: 'build-test' | ||
on: | ||
pull_request: | ||
|
||
jobs: | ||
report-updated-dependencies: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: AurorNZ/report-updated-dependencies@v1 | ||
``` | ||
or run conditionally | ||
```yml | ||
name: 'build-test' | ||
on: # rebuild any PRs and main branch changes | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- 'releases/*' | ||
|
||
jobs: | ||
report-updated-dependencies: | ||
if: ${{ github.event_name == 'pull_request' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: AurorNZ/report-updated-dependencies@v1 | ||
``` | ||
## Publish to a distribution branch | ||
Actions are run from GitHub repos so we will checkin the packed dist folder. | ||
Then run [ncc](https://github.com/zeit/ncc) and push the results: | ||
```bash | ||
$ npm run package | ||
$ git add dist | ||
$ git commit -a -m "prod dependencies" | ||
$ git push origin releases/v1 | ||
``` | ||
|
||
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. | ||
|
||
Your action is now published! :rocket: | ||
|
||
See the [versioning documentation](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md) | ||
|
||
|
||
## Debugging | ||
- Create a pull request, ideally with commits that update dependencies | ||
- 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. | ||
- Put the `event.json` file into the root of this repository | ||
- Add the following code to `.env` file | ||
``` | ||
GITHUB_EVENT_NAME=pull_request | ||
GITHUB_EVENT_PATH=event.json | ||
INPUT_TOKEN=<YOUR_GITHUB_TOKEN> | ||
``` | ||
- Hit F5 in VSCode to start debugging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters