You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of keeping the command to run and the destination to where
upload the artifacts harcoded, we can use the action `inputs` and
fallback to the built-in configuration.
These changes introduce a Data Structure called `Configuration` holding
the options coming from the external.
The options are lazy in the sense that, the `Configuration` class has a
dependency over the `core.getInput` so that we only call the function
when we actually need the value.
The `Configuration` properties are consumed via their getters.
Copy file name to clipboardExpand all lines: README.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,8 @@ Assets Artifacts, is designed to compile the assets of your project and commit a
14
14
15
15
## Configuration
16
16
17
-
The configuration for this action is mostly hardcoded for now. The command used for compiling the assets is always `yarn build` and the target directory is always `./build`.
17
+
-`command` Pass the command the action has to use to build the artifacts. Default to `yarn build`.
18
+
-`target-dir` Pass the director where the action has to store the artifacts. Default to `build`.
18
19
19
20
## Workflow Example
20
21
@@ -51,10 +52,13 @@ jobs:
51
52
GIT_USER: ${{ secrets.GIT_USER }}
52
53
GIT_EMAIL: ${{ secrets.GIT_EMAIL }}
53
54
HUSKY: 0
55
+
with:
56
+
command: 'npm run build'
57
+
target-dir: './dist'
54
58
```
55
59
56
60
In this workflow, the action is triggered on every push event that includes a tag. The workflow runs on the latest version of Ubuntu and will not run if the commit message contains `--skip-assets-artifacts`.
57
61
58
-
The workflow includes steps to checkout the repository, setup Node.js with a specified version and cache configuration, install dependencies using `yarn install`, and finally, build the artifacts using the `widoz/github-artifacts-action@v1` action.
62
+
The workflow includes steps to check out the repository, setup Node.js with a specified version and cache configuration, install dependencies using `yarn install`, and finally, build the artifacts using the `widoz/github-artifacts-action@v1` action.
59
63
60
64
The `GIT_USER` and `GIT_EMAIL` environment variables are used for the commit and should be stored as secrets in your GitHub repository. The `HUSKY` environment variable is set to `0` to disable Husky during the action run.
0 commit comments