Skip to content

Commit

Permalink
ci(PR): derive and json ser [skip-ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
clearloop committed Jan 16, 2024
1 parent c5a9293 commit 685e6b3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/actions/message/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ async function mock(head_sha) {
*/
async function main() {
console.log(github.context.payload);
console.log(JSON.stringify(github.context.payload, null, 2));
const {
pull_request: { head: { sha }, labels: _labels, title },
pull_request: { title, head: { sha, ref: branch }, labels: _labels },
repository: { full_name: fullName }
} = github.context.payload;
const labels = _labels.map(l => l.name);
Expand All @@ -56,15 +55,18 @@ async function main() {
core.info("message: ", message);
core.info("head-sha: ", sha);
core.info("title: ", title);
core.info("derive-title: ", github.context.payload.pull_request.title);
core.info("json-title: ", JSON.stringify(github.context.payload.pull_request.title));
core.info("full name: ", fullName);
core.info("api-full-name: ", github.context.payload.repository.full_name);
core.info("json-full-name: ", JSON.stringify(github.context.payload.repository.full_name));
core.info("labels: ", labels);

// Calculate configurations.
const isDepbot = fullName === `${owner}/${repo}` && title.includes(DEPBOT);
const skipCache = [title, message].some(s => s.includes(SKIP_CACHE));
const skipCI = [title, message].some(s => s.includes(SKIP_CI));
const build = !skipCI && (isDepbot || BUILD_LABELS.some(label => labels.includes(label)));
const branch = github.context.payload.repository.ref;

// Set outputs
core.setOutput("build", build);
Expand Down

0 comments on commit 685e6b3

Please sign in to comment.