Skip to content

Commit

Permalink
feat: move entire action logic to node script (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav authored Jul 22, 2021
1 parent e5afcae commit 0fc37ba
Show file tree
Hide file tree
Showing 9 changed files with 7,238 additions and 88 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ node_modules/
jspm_packages/

# Compiled files
dist
tmp

# Optional npm cache directory
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

In order to publish a new version of the action, simply update the "version" in the package.json and merge into the main branch.

If your changed files include `find-successful-workflow.js`, then you should also update the bundle in the `dist` folder using `npm run build`.

The workflow at ./github/workflows/publish.yml will apply the new version in the form of tags, which is all that is needed to publish an Action.

Example of tags applied:
Expand Down
3 changes: 2 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ inputs:
default: "true"
error-on-no-successful-workflow:
description: "By default, if no successful workflow is found on the main branch to determine the SHA, we will log a warning and use HEAD~1. Enable this option to error and exit instead."
default: "false"
workflow-id:
description: "The ID of the workflow to track or name of the file name. E.g. ci.yml. Defaults to current workflow"

Expand All @@ -27,7 +28,7 @@ runs:
- name: Set base and head SHAs used for nx affected
id: setSHAs
shell: bash
run: ${{ github.action_path }}/run.sh ${{ github.token }} ${{ github.event_name }} ${{ inputs.main-branch-name }} ${{ inputs.error-on-no-successful-workflow }} ${{ inputs.workflow-id }}
run: node ${{ github.action_path }}/dist/index.js ${{ github.token }} ${{ inputs.main-branch-name }} ${{ inputs.error-on-no-successful-workflow }} ${{ inputs.workflow-id }}

- name: Log base and head SHAs used for nx affected
shell: bash
Expand Down
Loading

0 comments on commit 0fc37ba

Please sign in to comment.