Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/credfeto/action-repo-visibility
Checks repo visibility
https://github.com/credfeto/action-repo-visibility
Last synced: about 1 month ago
JSON representation
Checks repo visibility
- Host: GitHub
- URL: https://github.com/credfeto/action-repo-visibility
- Owner: credfeto
- License: mit
- Created: 2022-06-05T13:00:56.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-10T16:06:05.000Z (9 months ago)
- Last Synced: 2024-04-10T19:57:39.616Z (9 months ago)
- Language: Shell
- Size: 1.27 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
# action-repo-visibility
Checks the github repository's visibility to see if it is public or private so that the workflow can be customised
and enable tasks that should only occur on public or private repos.## How to use it?
This is a Github action, so it has to be added to a github workflow.A simple example of running this action on all pushes to the repository would be
add a `visibility.yml` file under `.github/workflows` with the following content.```yamlstatus
name: Test Workflowon:
[push]jobs:
test:runs-on: ubuntu-latest
steps:
- uses: credfeto/[email protected]
id: visibility
with:
# optional parameter defaults to the current repo
repository: ${{ github.repository }}
# optional parameter defaults to the current user
token: ${{ github.token }}- if: ${{ steps.visibility.outputs.is_public == 'true' }}
run: echo "Repo is Public"
# Run additional tasks that are required for public repos
# e.g. alerting that the repo is public when it should not be- if: ${{ steps.visibility.outputs.is_private == 'true' }}
run: echo "Repo is PRIVATE"
# Run additional steps that are only required on private repos- run: echo "Status ${{ steps.visibility.outputs.status }}"
- run: echo "Public ${{ steps.visibility.outputs.is_public }}"
- run: echo "Private ${{ steps.visibility.outputs.is_private }}"
```## Changelog
See [CHANGELOG](CHANGELOG.md) for history
## Contributors