Skip to content

Commit

Permalink
WIP: Get workflows from head_sha
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeharder committed Dec 5, 2024
1 parent 072171f commit c833eb9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/actions/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @param {import('github-script').AsyncFunctionArguments['github']} github
* @param {import('github-script').AsyncFunctionArguments['context']} context
* @param {import('github-script').AsyncFunctionArguments['core']} core
* @returns {Promise<{owner: string, repo: string, issue_number: number, run_id: number }>}
* @returns {Promise<{owner: string, repo: string, head_sha: string, issue_number: number, run_id: number }>}
*/
async function extractInputs(github, context, core) {
core.info(`extractInputs(${context.eventName}, ${context.payload.action})`);
Expand All @@ -22,6 +22,7 @@ async function extractInputs(github, context, core) {
const inputs = {
owner: payload.repository.owner.login,
repo: payload.repository.name,
head_sha: payload.pull_request.head.sha,
issue_number: payload.number,
run_id: NaN
};
Expand Down
7 changes: 7 additions & 0 deletions .github/actions/update-labels/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ module.exports = async ({ github, context, core }) => {

artifactNames = artifacts.data.artifacts.map((a) => a.name);
} else {
const workflows = await github.rest.actions.listWorkflowRunsForRepo({
owner,
repo,
event: 'pull_request',
status: 'completed'
head_sha: context.payload.
});
// TODO: List all artifacts of issue_number
}

Expand Down

0 comments on commit c833eb9

Please sign in to comment.