diff --git a/.github/workflows/hello-yaml-command.yaml b/.github/workflows/hello-yaml-command.yaml deleted file mode 100644 index 8b2bfc5..0000000 --- a/.github/workflows/hello-yaml-command.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: Hello yaml Command -on: - repository_dispatch: - types: [hello-yaml-local-command] -jobs: - helloYaml: - runs-on: ubuntu-latest - steps: - - name: Add reaction - uses: peter-evans/create-or-update-comment@v5 - with: - comment-id: ${{ github.event.client_payload.github.payload.comment.id }} - reactions: hooray - - - name: Create URL to the run output - id: vars - run: echo "run-url=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_OUTPUT - - - name: Create comment - uses: peter-evans/create-or-update-comment@v5 - with: - issue-number: ${{ github.event.client_payload.github.payload.issue.number }} - body: | - Hello @${{ github.event.client_payload.github.actor }}! - - This command was in a workflow file with the `.yaml` extension. - - [Click here to see the command run output][1] - - [1]: ${{ steps.vars.outputs.run-url }} diff --git a/dist/index.js b/dist/index.js index 9619640..0f45306 100644 --- a/dist/index.js +++ b/dist/index.js @@ -394,8 +394,8 @@ class GitHubHelper { const { data: workflows } = yield this.octokit.rest.actions.listRepoWorkflows(Object.assign({}, this.parseRepository(repository))); for (const workflow of workflows.workflows) { core.debug(`Found workflow: ${workflow.path}`); - if (workflow.path === `${workflowName}.yml` || - workflow.path === `${workflowName}.yaml`) { + if (workflow.path.endsWith(`${workflowName}.yml`) || + workflow.path.endsWith(`${workflowName}.yaml`)) { core.debug(`Selecting workflow file ${workflow.path}`); return workflow.path; } diff --git a/src/github-helper.ts b/src/github-helper.ts index 2f455e9..3528aed 100644 --- a/src/github-helper.ts +++ b/src/github-helper.ts @@ -197,8 +197,8 @@ export class GitHubHelper { for (const workflow of workflows.workflows) { core.debug(`Found workflow: ${workflow.path}`) if ( - workflow.path === `${workflowName}.yml` || - workflow.path === `${workflowName}.yaml` + workflow.path.endsWith(`${workflowName}.yml`) || + workflow.path.endsWith(`${workflowName}.yaml`) ) { core.debug(`Selecting workflow file ${workflow.path}`) return workflow.path