Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow sharing common parameters between steps #145

Open
hoxu opened this issue Jul 5, 2021 · 1 comment
Open

Allow sharing common parameters between steps #145

hoxu opened this issue Jul 5, 2021 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@hoxu
Copy link

hoxu commented Jul 5, 2021

Consider a workflow that has three jobs, each with a step that calls action-slack, for example:

- uses: 8398a7/action-slack@v3
  with:
    status: custom
    fields: workflow,job,commit,repo,ref,author,took
    custom_payload: |
      {
        attachments: [{
          color: '${{ job.status }}' === 'success' ? 'good' : '${{ job.status }}' === 'failure' ? 'danger' : 'warning',
          text: `${process.env.AS_WORKFLOW}\n${process.env.AS_JOB} (${process.env.AS_COMMIT}) of ${process.env.AS_REPO}@${process.env.AS_REF} by ${process.env.AS_AUTHOR} ${{ job.status }} in ${process.env.AS_TOOK}`,
        }]
      }
  env:
    SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

That would be a lot of copy-paste (and potential drifting) between the jobs. As GitHub Actions does not seem to support YAML anchors, it would be nice if this action had some way of defining common options for a workflow, and then defaulting to them unless overridden.

@8398a7
Copy link
Owner

8398a7 commented Jul 23, 2021

Thank you for your suggestion.
Can you make a pull request?

@8398a7 8398a7 added the help wanted Extra attention is needed label Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants