Skip to content

Commit 0fc37ba

Browse files
authored
feat: move entire action logic to node script (#4)
1 parent e5afcae commit 0fc37ba

9 files changed

Lines changed: 7238 additions & 88 deletions

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ node_modules/
1919
jspm_packages/
2020

2121
# Compiled files
22-
dist
2322
tmp
2423

2524
# Optional npm cache directory

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

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

5+
If your changed files include `find-successful-workflow.js`, then you should also update the bundle in the `dist` folder using `npm run build`.
6+
57
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.
68

79
Example of tags applied:

action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ inputs:
1010
default: "true"
1111
error-on-no-successful-workflow:
1212
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."
13+
default: "false"
1314
workflow-id:
1415
description: "The ID of the workflow to track or name of the file name. E.g. ci.yml. Defaults to current workflow"
1516

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

3233
- name: Log base and head SHAs used for nx affected
3334
shell: bash

0 commit comments

Comments
 (0)