Open jbinda opened 4 years ago
To not introduce breaking change I would suggest to config
data directly from env during the local run
Github actions require uppercased values https://github.com/actions/toolkit/blob/905c2aa21671e57683c7113418f7bc4eaed964be/packages/core/src/core.ts#L67
To not introduce breaking change I would suggest to
config
data directly from env during the local run Github actions require uppercased values https://github.com/actions/toolkit/blob/905c2aa21671e57683c7113418f7bc4eaed964be/packages/core/src/core.ts#L67
Hmm ok I was using it like INPUT_GITHUB_TOKEN
in my .env
file. The problem was in attempt to pull it because I thought that it needs to be aligned with actions.yml
NOT WORKING
const GITHUB_TOKEN = core.getInput('github-token', {
required: true,
});
After changing to this is works fine and we do need to modify action.yml
as you pointed. Thanks !
WORKING
const GITHUB_TOKEN = core.getInput('GITHUB_TOKEN', {
required: true,
});
However I wonder if we still do not want to include that breaking change to align name patter - WDYT ?
Implemented in #24
Tested and confirmed working
closes #10
I have provide some refactor that allow to run action locally. Do not modify README.md yet however the steps to run locally are as follow:
yarn dev:init
to copy example .env file and configs fromexample
folder ( pass-o
if you want to override already existing files in root directory having the same name ).env
and pass your github token (see the comment inside env on how to get it) as well as test repo name and owner in below patternkeep
GH_ACTION_LOCAL_TEST=true
to not proceed any action on mentioned repo. Comment this line to allow modification of result on repoconfigure
event.pr.json
andevent.issue.json
to mock issue / pr payloadrun
yarn dev:issue
to simulate action on issuerun
yarn dev:pr
to simulate action on prCHANGES
types.t.ds
(need to move main function from index.ts file)superLabeler.ts' and call it from
index.ts`index.ts
dryRun
prop to disable proceed action on repo (e.g when applying labels after match)examples
foldercopyLocalRun.js
script to allow copy examples configs in quick wayBREAKING_CHANGES: I have noticed that there was a problem to pass token from local
.env
when its name was 'github-token' inaction.yml
. After I have change it toGITHUB_TOKEN
it start to workCONCLUSION Let me know what you think ( probably naming etc is not 100% accurate) however lets focus on the approach first.
With above setup we can mock events and see results without pushing the code to repo and manually modifying the issue/pr in test repo. I'm also working with extend logging system and will target this PR when finish