![]() Note: If you use both the branches filter and the paths filter, the workflow will only run when both filters are satisfied. For more information, see " Workflow syntax for GitHub Actions."įor example, this workflow will run when a pull request includes a change to a JavaScript file (. You can also configure your workflow to run when a pull request changes specific files. For example, this workflow will run whenever a pull request is opened, but the run_if job will only execute if the head of the pull request is a branch whose name starts with releases/: on: pull_request: types: - opened jobs: run_if: if: startsWith(github.head_ref, 'releases/' ) runs-on: ubuntu-latest steps: - run: echo "The head of this PR starts with 'releases/'" Running your pull_request workflow based on files changed in a pull request To run a job based on the pull request's head branch name (as opposed to the pull request's base branch name), use the github.head_ref context in a conditional. js) file is opened on a branch whose name starts with releases/: on: pull_request: types: - opened branches: - 'releases/**' paths: - '**.js' For example, the following workflow will only run when a pull request that includes a change to a JavaScript (. For more information, see " Workflow syntax for GitHub Actions."įor example, this workflow will run when someone opens a pull request that targets a branch whose name starts with releases/: on: pull_request: types: - opened branches: - 'releases/**' You can use the branches or branches-ignore filter to configure your workflow to only run on pull requests that target specific branches. on: issue_comment jobs: pr_commented: # This job only runs for pull request comments name: PR comment if: $ steps: - run: echo 'A review from octo-team was requested' Running your pull_request workflow based on the head or base branch of a pull request It will run the issue_commented job only if the issue_comment event originated from an issue. You can use the _request property in a conditional to take different action depending on whether the triggering object was an issue or pull request.įor example, this workflow will run the pr_commented job only if the issue_comment event originated from a pull request. The issue_comment event occurs for comments on both issues and pull requests. Issue_comment on issues only or pull requests only ![]() For information about the issue comment APIs, see " Objects" in the GraphQL API documentation or " Webhook events and payloads" in the REST API documentation.įor example, you can run a workflow when an issue or pull request comment has been created or deleted. Runs your workflow when an issue or pull request comment is created, edited, or deleted. Note: This event will only trigger a workflow run if the workflow file is on the default branch. on: deployment deployment_status Webhook event payloadīranch or tag to be deployed (empty if commit) For information about the APIs to create a deployment, see " Mutations" in the GraphQL API documentation or " Repositories" in the REST API documentation.įor example, you can run a workflow when the deployment event occurs. Deployments created with a commit SHA may not have a Git ref. Runs your workflow when someone creates a deployment in the workflow's repository. ![]() on: delete deployment Webhook event payloadīranch or tag to be deployed (empty if created with a commit SHA) For information about the APIs to delete a Git reference, see " Mutations" in the GraphQL API documentation or " Git database" in the REST API documentation.įor example, you can run a workflow when the delete event occurs. Runs your workflow when someone deletes a Git reference (Git branch or tag) in the workflow's repository. Note: An event will not be created when you delete more than three tags at once.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |