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

Support specific ref passed on workflow_dispatch input #176

Open
GroJooo opened this issue Apr 3, 2024 · 0 comments
Open

Support specific ref passed on workflow_dispatch input #176

GroJooo opened this issue Apr 3, 2024 · 0 comments

Comments

@GroJooo
Copy link

GroJooo commented Apr 3, 2024

Hi,
Thanks for the hard work !

I'm having a particular use case here:

  • I'm manually running my workflow using workflow_dispatch
  • I have defined a commitSpecific optional input which permits to pass a specific SHA-1 ref to my worflow instead oh HEAD

In this case, I'm unable to change the ref passed to action-slack-notif so it can be overriden in the Slack Notif "commit" field.

Is there a way to work around this ?

Below a fraction of my YAML file:

on:
  workflow_dispatch:

    inputs:
        
      environment:
        required: true
        default: 'test'
        type: choice
        description: Which environment ?
        options:
          - test
          - staging
          - prod
      
      build_assets:
        required: false
        type: boolean
        description: Build assets ?

      commitSpecific:
        required: false
        type: string
        description: Specify cutom SHA-1 commit hash (Optional)

 jobs:
  build:
    runs-on: ubuntu-22.04
    steps:
    
    - name: Project Checkout Latest
      if: ${{ inputs.commitSpecific == '' }}
      uses: actions/checkout@v3

    - name: Project Checkout Specific
      if: ${{ inputs.commitSpecific != '' }}
      uses: actions/checkout@v3
      with:
        ref: ${{ inputs.commitSpecific }}

    - name: Job Start Slack Notification
      uses: rtCamp/action-slack-notify@v2
      env:
        SLACK_USERNAME: GitHub Actions
        SLACK_COLOR: '#FFFF33'
        SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
        SLACK_MESSAGE: 'Job started on ${{ inputs.environment }} env with assets deploy : ${{ inputs.build_assets }}'
        SLACK_FOOTER: ''

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant