Skip to content

Commit

Permalink
ci: workaround for the undefined steps
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRustifyer committed Dec 27, 2024
1 parent 149eb67 commit 051a996
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/deploy-chatbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ jobs:
id: notify-user
with:
script: |
console.log(context)
console.log(github)
console.log(`GITHUB: ${JSON.stringify(github, null, 2)}`);
const script = require('./actions_scripts/notify_user.js')
await script({github, context})
Expand Down
15 changes: 3 additions & 12 deletions actions_scripts/notify_user.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
module.exports = async ({github, context, steps}) => {
console.log(`GITHUB: ${JSON.stringify(github, null, 2)}`);
module.exports = async ({github, context, environment, project, infra}) => {
console.log(`CTX: ${JSON.stringify(context, null, 2)}`);
console.log(`process: ${JSON.stringify(process.env, null, 2)}`);
const {SHA} = process.env
console.log(`SHA: ${SHA}`)
// console.log(`STEPS: ${JSON.stringify(steps, null, 2)}`);

const environment = steps.parse_command.outputs.environment;
const project = steps.parse_command.outputs.project;
const infra = steps.parse_command.outputs.infra;

const actor = github.event.comment.user.login;
const actor = context.actor;
console.log(`Actor: ${actor}`)
const username = (actor !== "") ? actor : 'Unknown';

Expand All @@ -27,7 +18,7 @@ module.exports = async ({github, context, steps}) => {
message += `- Infrastructure: \`${infra}\`\n`;
}

if (`${ github.event.act }` === 'true') {
if (context.payload.act === 'true') {
console.log(`Action is being runned locally by 'ACT'.
Skipping the notify user on PR, but output would have been:
${message}`);
Expand Down

0 comments on commit 051a996

Please sign in to comment.