From e757788068d60f4bcc5da9a139d5f6015c70d1f1 Mon Sep 17 00:00:00 2001 From: Victor Date: Fri, 15 Dec 2023 22:24:43 +0000 Subject: [PATCH] ci: update action docs --- .pre-commit-config.yaml | 7 +++++++ README.md | 33 +++++++++++++++++++++++---------- script/update-action-readme | 14 ++++++++++++++ 3 files changed, 44 insertions(+), 10 deletions(-) create mode 100755 script/update-action-readme diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2c5ccfe..8cbd8ed 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,3 +26,10 @@ repos: rev: v1.6.26 hooks: - id: actionlint + - repo: local + hooks: + - id: update-action-readme + name: update-action-readme + entry: ./script/update-action-readme + language: script + files: '.*action\.yaml$' diff --git a/README.md b/README.md index aeb1d5d..ab87bf9 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,12 @@ # `open-turo/action-git-auth` -This [GitHub Action](https://docs.github.com/en/actions) provides a way to -configure credentials for any utility that uses the git command, or any utility -that uses the git command as a subprocess, or any utility that uses the git -configuration file in its authentication and cloning. + + +## Description + +This [GitHub Action](https://docs.github.com/en/actions) provides a way to configure credentials for any utility that uses the git command, or any utility that uses the git command as a subprocess, or any utility that uses the git configuration file in its authentication and cloning. + + Authenticates using URL patterns that match https://_server_/_prefix_\*. If no matching URL exists, the action will not use the authentication credentials @@ -73,17 +76,27 @@ jobs: ${{ secrets.PERSONAL_ACCESS_TOKEN }} ``` + + ## Inputs -| parameter | description | required | default | -| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------- | -| github-personal-access-token | A GitHub personal access token that has appropriate access in the consumer GitHub repository that will be used for authentication with GitHub. | `true` | | -| prefix | The prefix to use for the URL path rewrite. This will often be an organization name if you wish to limit which repositories are accessible. | `false` | | -| server | The name of the GitHub server to use, if not using hosted. This is useful if you are running this action against a GitHub Enterprise instance. | `false` | | +| parameter | description | required | default | +| --- | --- | --- | --- | +| github-personal-access-token | A GitHub personal access token that has appropriate access in the consumer GitHub repository that will be used for authentication with GitHub. | `true` | | +| prefix | The prefix to use for the URL path rewrite. This will often be an organization name if you wish to limit which repositories are accessible. | `false` | | +| server | The name of the GitHub server to use, if not using hosted. This is useful if you are running this action against a GitHub Enterprise instance. | `false` | | + + + + + + ## Runs -This action is an `node16` action. +This action is a `node20` action. + + ## Development diff --git a/script/update-action-readme b/script/update-action-readme new file mode 100755 index 0000000..396b99b --- /dev/null +++ b/script/update-action-readme @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +set -e + +for i in $*; do + # ignore if the file does not end with /action.yaml + if [[ "$i" != *"action.yaml" ]]; then + echo "skipping: ${i}" + continue + fi + readme_file=$(dirname "$i")/README.md + echo "npx action-docs --no-banner -a "${i}" --update-readme "${readme_file}"" + npx action-docs --no-banner -a "${i}" --update-readme "${readme_file}" +done