Skip to content

Commit f3c0e00

Browse files
committed
feat(action): add "pre" step to load inputs
1 parent 78c763b commit f3c0e00

File tree

4 files changed

+61
-7
lines changed

4 files changed

+61
-7
lines changed

action.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,7 @@ branding:
99
runs:
1010
using: "node20"
1111
main: "action/build/index.js"
12-
pre: |
13-
echo "LINGODOTDEV_API_KEY=${{ inputs.api-key }}" >> $GITHUB_ENV
14-
echo "LINGODOTDEV_PULL_REQUEST=${{ inputs.pull-request }}" >> $GITHUB_ENV
15-
echo "LINGODOTDEV_COMMIT_MESSAGE=${{ inputs.commit-message }}" >> $GITHUB_ENV
16-
echo "LINGODOTDEV_PULL_REQUEST_TITLE=${{ inputs.pull-request-title }}" >> $GITHUB_ENV
17-
echo "LINGODOTDEV_WORKING_DIRECTORY=${{ inputs.working-directory }}" >> $GITHUB_ENV
18-
echo "LINGODOTDEV_PROCESS_OWN_COMMITS=${{ inputs.process-own-commits }}" >> $GITHUB_ENV
12+
pre: "action/build/pre.js"
1913

2014
inputs:
2115
api-key:

action/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"build": "tsc"
55
},
66
"dependencies": {
7+
"@actions/core": "^1.11.1",
78
"@gitbeaker/rest": "^39.34.3",
89
"bitbucket": "^2.12.0",
910
"octokit": "^4.0.2",

action/src/pre.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import core from "@actions/core";
2+
3+
process.env.LINGODOTDEV_API_KEY = core.getInput("api-key");
4+
process.env.LINGODOTDEV_PULL_REQUEST = core.getInput("pull-request");
5+
process.env.LINGODOTDEV_COMMIT_MESSAGE = core.getInput("commit-message");
6+
process.env.LINGODOTDEV_PULL_REQUEST_TITLE = core.getInput("pull-request-title");
7+
process.env.LINGODOTDEV_WORKING_DIRECTORY = core.getInput("working-directory");
8+
process.env.LINGODOTDEV_PROCESS_OWN_COMMITS = core.getInput("process-own-commits");

pnpm-lock.yaml

Lines changed: 51 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)