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

getting this error when merge with master #244

Open
Nishitsuthar opened this issue Aug 10, 2023 · 0 comments
Open

getting this error when merge with master #244

Nishitsuthar opened this issue Aug 10, 2023 · 0 comments

Comments

@Nishitsuthar
Copy link

getting an error from workflow

When I merge my changes with the master (which has protection rule) and workflow throw an error /home/runner/work/_temp/69da30f1-2883-4fbc-9bf3-cae84ad97f70.sh: line 39: timestamp:: command not found

Expected behavior
It should send an notification to slack that your changes are merged

Screenshots
image

Code

name: Slack Notification

on:
  push:
  pull_request:
  issues:
    types: [opened, closed, reopened, edited, deleted, pinned, unpinned, assigned, unassigned, labeled, unlabeled, milestoned, demilestoned]
  issue_comment:
    types: [created, edited, deleted]
  create:
  delete:

permissions:
  contents: read
  actions: read

jobs:
  notify_slack:
    runs-on: ubuntu-latest
    steps:
    - name: Debug Print Event
      run: |
        echo "Event Name: ${{ github.event_name }}"
        echo "Event JSON: ${{ toJson(github.event) }}"
    - name: Send Slack notification
      env:
        SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
      uses: 8398a7/action-slack@v3
      with:
        icon_emoji: ':octocat:'
        status: custom
        fields: repo,commit,event,action,workflow,ref,url
        custom_payload: |
          {
            "attachments": [
              {
                "color": "${{ job.status }}",
                "title": "${{ github.actor }} ${{ github.event.pull_request && github.event.pull_request.merged == true && 'merged a pull request' || github.event.pull_request && 'opened a pull request' || github.event_name == 'push' && 'pushed new changes' || github.event_name == 'create' && 'created a new branch or tag' || github.event_name == 'delete' && 'deleted a branch or tag' || github.event_name == 'issues' && github.event.action || 'triggered an event' }}",
                "text": ":tada: Event details:\n\n- Repository: ${{ github.repository }}\n- Branch: ${{ github.ref }}\n- Message: ${{ github.event_name == 'push' && github.event.head_commit.message || github.event_name == 'issues' && github.event.issue.title || github.event_name == 'pull_request' && github.event.pull_request.title || '' }}\n- :globe_with_meridians: Link: ${{ github.event.pull_request.html_url || github.event.issue.html_url || github.event.repository.html_url }}"
              }
            ]
          }

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