https://github.com/smashedr/py-test-action
Python Test Action
https://github.com/smashedr/py-test-action
Last synced: 9 months ago
JSON representation
Python Test Action
- Host: GitHub
- URL: https://github.com/smashedr/py-test-action
- Owner: smashedr
- License: mit
- Created: 2024-07-22T04:38:42.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2025-02-17T01:16:02.000Z (over 1 year ago)
- Last Synced: 2025-08-23T10:04:36.526Z (9 months ago)
- Language: Python
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/smashedr/py-test-action/actions/workflows/tags.yaml)
[](https://github.com/smashedr/py-test-action/actions/workflows/test.yaml)
[](https://sonarcloud.io/summary/new_code?id=smashedr_py-test-action)
[](https://github.com/smashedr/py-test-action/releases/latest)
[](https://github.com/smashedr/py-test-action/graphs/commit-activity)
[](https://codeberg.org/shaner/py-test-action)
[](https://github.com/smashedr/py-test-action)
[](https://cssnr.github.io/)
[](https://discord.gg/wXy6m2X8wY)
# Python Test Action
This action creates or updates the provided `tag` to the `sha` has that triggered the workflow.
This includes inputs, outputs, job summary, and automatic token authentication.
> [!NOTE]
> Note: this is a simple docker action and is built every run from the Dockerfile.
> If you have a more complex build you should build and push images to GHCR.
> For this you should instead use this template: https://github.com/smashedr/docker-test-action
- [Inputs](#Inputs)
- [Outputs](#Outputs)
- [Examples](#Examples)
- [Development](#Development)
## Inputs
| input | required | default | description |
| ------- | -------- | --------------------- | --------------------------- |
| tag | No | test | Tag to Create or Update |
| summary | No | true | Add Summary to Job |
| token | No | `${{ github.token }}` | Only if External Token [^1] |
With no inputs this will create/update the tag `test`.
```yaml
- name: 'Python Test Action'
uses: smashedr/py-test-action@v1
```
With all inputs. Note that `token` is NOT required.
```yaml
- name: 'Python Test Action'
uses: smashedr/py-test-action@v1
with:
tag: test
summary: true
token: ${{ secrets.PAT }} # only include this if you need to use a PAT
```
### Permissions
This action requires the following permissions:
```yaml
permissions:
contents: write
```
## Outputs
| output | description |
| ------ | ----------- |
| sha | Tag Hash |
```yaml
- name: 'Python Test Action'
id: test
uses: smashedr/py-test-action@v1
- name: 'Echo Output'
run: |
echo "sha: '${{ steps.test.outputs.sha }}'"
```
## Examples
```yaml
name: 'Test'
on:
workflow_dispatch:
push:
jobs:
test:
name: 'Test'
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: write
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Python Test Action'
id: test
uses: smashedr/py-test-action@v1
- name: 'Echo Outputs'
run: |
echo "sha: '${{ steps.test.outputs.sha }}'"
```
# Development
If you would like to submit a PR, please review the [CONTRIBUTING.md](CONTRIBUTING.md).
1. Install `act`: https://nektosact.com/installation/index.html
2. Create a `.secrets` file with: `GITHUB_TOKEN="ghp_xxx"`
3. Run `act -j test`
For advanced using with things like secrets, variables and context see: https://nektosact.com/usage/index.html
You should also review the options from `act --help`
Note, the `.env`, `.secrets` and `.vars` files are automatically sourced with no extra options.
To source `event.json` you need to run act with `act -e event.json`
[^1]:
The `${{ github.token }}` / `{{ secrets.GITHUB_TOKEN }}` is automatically passed, there is no need to manually pass these!
This is only available to allow users to pass a different token they have created and defined in their `secrets`.