Skip to content

Connehito/deploying-marker-with-issue

Repository files navigation

deploying-marker-with-issue

Check dist/ CodeQL example

This action checks, attaches and detaches the "Deploying" label of GitHub Issue that indicating the deployment status.

How to Use

Example workflow and issue

Permission

deploying-marker-with-issue needs issue: write permission.

permissions:
  issues: write

Ref: Assigning permissions to jobs - GitHub Docs

1. Check marker detached

Checks the Issue has not Deploying label. If the Issue already has Deploying label and specified exit-with-error: true, an error is raised. For example, you want to check another deployment is not in progress.

- uses: Connehito/deploying-marker-with-issue@v2
  env:
    GITHUB_TOKEN: ${{ github.token }}
  with:
    action: "check-marker-detached"
    issue-number: ${{ env.DEPLOYMENT_RECORD_ISSUE_NUMBER }}
    exit-with-error: true # true = exit with error when the marker is already exists

2. Attach marker

Attach Deploying label to the Issue. If the Issue already has Deploying label and specified exit-with-error: true, an error is raised. It is intended to be used at the start of a deployment.

- uses: Connehito/deploying-marker-with-issue@v2
  env:
    GITHUB_TOKEN: ${{ github.token }}
  with:
    action: "attach-marker"
    issue-number: ${{ env.DEPLOYMENT_RECORD_ISSUE_NUMBER }}
    exit-with-error: true # true = exit with error when the marker is already exists

3. Check marker attached

Checks the Issue has Deploying label. If the Issue has not Deploying label and specified exit-with-error: true, an error is raised. For example, you can use to check Deployment label has not detached.

- uses: Connehito/deploying-marker-with-issue@v2
  env:
    GITHUB_TOKEN: ${{ github.token }}
  with:
    action: "check-marker-attached"
    issue-number: ${{ env.DEPLOYMENT_RECORD_ISSUE_NUMBER }}
    exit-with-error: false # true = exit with error when the marker is not exists

4. Detach marker

Detach Deploying label to the Issue. If the Issue has not Deploying label and specified exit-with-error: true, an error is raised. It is intended to be used at the end of a deployment.

- uses: Connehito/deploying-marker-with-issue@v2
  env:
    GITHUB_TOKEN: ${{ github.token }}
  with:
    action: "detach-marker"
    issue-number: ${{ env.DEPLOYMENT_RECORD_ISSUE_NUMBER }}
    exit-with-error: false # true = exit with error when the marker is not exists

5. Check marker detached or assigned actor

Checks the Issue has not Deploying label or assigned actor. If the issue has a Deploying label or assigned user who is not the actor, and `exit-with-error: true' is specified, an error is raised. For example, if you want to run consecutive deployments.

- uses: Connehito/deploying-marker-with-issue@main
  env:
    GITHUB_TOKEN: ${{ github.token }}
  with:
    action: "check-marker-detached-or-assigned-actor"
    issue-number: ${{ env.DEPLOYMENT_RECORD_ISSUE_NUMBER }}
    exit-with-error: true # true = exit with error when the marker is already exists and assigned a user who is not the actor

About

This action checks, attaches and detaches the "Deploying" label of GitHub Issue that indicating the deployment status.

Topics

Resources

License

Stars

Watchers

Forks