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

Worflow is not triggered by new tag #188

Open
craftcodedev opened this issue Apr 19, 2024 · 1 comment
Open

Worflow is not triggered by new tag #188

craftcodedev opened this issue Apr 19, 2024 · 1 comment

Comments

@craftcodedev
Copy link

craftcodedev commented Apr 19, 2024

Hello,

I have an github workflow to be trigger when a new tag is created by antother workflow using the chart-releaser-action. You can see the following code:

Workflow using chart-releaser-action

`name: Release Charts

on:
  push:
    branches:
      - master

jobs:
  release:
    permissions:
      contents: write
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Configure Git
        run: |
          git config user.name "$GITHUB_ACTOR"
          git config user.email "[email protected]"

      - name: Install Helm
        uses: azure/setup-helm@v3

      - name: Run chart-releaser
        uses: helm/[email protected]
        with:
          charts_dir: apps
          config: "./.github/configs/cr.yaml"
        env:
          CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"`

Workflow to be trigger when a new tag is created:

`name: Build and push helm chart

on:
  push:
    tags:
      - '**'

jobs:
  build_and_push:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3`

The new tag is created by chart-releaser-action but the Build and push helm chart workflow is not being trigger. I tried to create and push manually a tag and the workflow is being trigger. So I think the problem is the way chart-releaser-action is creating the tag. Maybe it is related to this issue?

@pier-oliviert
Copy link

I believe you might be affected by an issue where any git operations done using the secrets.GITHUB_TOKEN will not trigger any workflow. I wasted a bunch of time yesterday and changing the token to a Personal Authentication Token (PAT) solved my issues:

When you use the repository's GITHUB_TOKEN to perform tasks, events triggered by the GITHUB_TOKEN, with the exception of workflow_dispatch and repository_dispatch, will not create a new workflow run. This prevents you from accidentally creating recursive workflow runs. For example, if a workflow run pushes code using the repository's GITHUB_TOKEN, a new workflow will not run even when the repository contains a workflow configured to run when push events occur. For more information, see "Automatic token authentication."

Triggering a workflow

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

2 participants