mirror of
https://github.com/ansible/dvcs-action
synced 2026-04-05 19:30:53 +00:00
No description
- Python 100%
Added comprehensive testing documentation to CONTRIBUTING.md including tox usage examples and environment options. Updated version reference from v3 to v5 in check_dvcs.py. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .github/workflows | ||
| .gitignore | ||
| action.yml | ||
| check_dvcs.py | ||
| CODE-OF-CONDUCT.md | ||
| CONTRIBUTING.md | ||
| COPYING | ||
| DCO | ||
| LICENSE | ||
| pyproject.toml | ||
| README.md | ||
| requirements.txt | ||
| requirements_test.txt | ||
| SECURITY.md | ||
| sonar-project.properties | ||
| test_check_dvcs.py | ||
Usage
This action validates the following in a PR:
- A commit in the pull request has the JIRA issue key in the commit message. Note, that the commit cannot be a merge commit.
- The JIRA issue key is at the beginning of the pull request title.
- The source branch name also includes the JIRA issue key at the beginning of the branch name.
To use this action create a github workflow like:
on:
pull_request_target:
type: opened, synchronize, reopened, edited
jobs:
dvcs_pr_checker:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
name: Check the PR for DVCS integration
steps:
- id: foo
uses: ansible/dvcs-action@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Testing locally
In order to test locally we need to set an environment variable called PULL_REQUEST.
This can be accomplished by doing a curl command (change and to match what you want to test):
export PULL_REQUEST=$(curl https://api.github.com/repos/ansible/<repo>/pulls/<pull number>)
After that is set you can run the python scrip with the --dry-run command to prevent it from trying to update the PR you are testing:
./check_dvcs.py --dry-run
This will add additional debugging statements as well as not trying to modify the PR.
NOTE: this will use unauthenticated GitHub API requests which are throttled by default. If you hit your limit you will need to wait until your counter resets to test again.