|  | 
| 1 |  | -# check-status  | 
|  | 1 | +<!-- start title --> | 
|  | 2 | + | 
|  | 3 | +# gitgitgadget Action: check-status | 
|  | 4 | + | 
|  | 5 | +<!-- end title --> | 
|  | 6 | +<!-- start description --> | 
|  | 7 | + | 
|  | 8 | +This is a GitHub action to perform various scheduled actions with projects using gitgitgadget to submit changes. It is used as a scheduled action running in a separate repo or the repo it is acting upon. The use case is for repos that will not allow complex GitHub actions in the codebase when the GitHub repo is a clone that is used to submit updates to a non-GitHub maintained repo. | 
|  | 9 | + | 
|  | 10 | +<!-- end description --> | 
|  | 11 | +<!-- start contents --> | 
|  | 12 | +<!-- end contents --> | 
|  | 13 | + | 
|  | 14 | +## Usage | 
|  | 15 | + | 
|  | 16 | +<!-- start usage --> | 
|  | 17 | + | 
|  | 18 | +```yaml | 
|  | 19 | +- uses : gitgitgadget/[email protected] | 
|  | 20 | +  with: | 
|  | 21 | +    # The action to be performed. It must be one of the following: "update-open-prs", | 
|  | 22 | +    # "update-commit-mappings", "handle-open-prs", "handle-new-mails". | 
|  | 23 | +    action: "" | 
|  | 24 | + | 
|  | 25 | +    # Repository owner. | 
|  | 26 | +    repo-owner: "" | 
|  | 27 | + | 
|  | 28 | +    # Repository name. | 
|  | 29 | +    repo-name: "" | 
|  | 30 | + | 
|  | 31 | +    # A repo scoped GitHub Personal Access Token. | 
|  | 32 | +    token: "" | 
|  | 33 | + | 
|  | 34 | +    # The location of the repository. | 
|  | 35 | +    repository-dir: "" | 
|  | 36 | + | 
|  | 37 | +    # The location of the repository with gitgitgadget configuration information. This | 
|  | 38 | +    # would be used in place of the `config` parameter for the `git` repository. This | 
|  | 39 | +    # is normally the gitgitgadget repo with any needed configuration settings. Most | 
|  | 40 | +    # users will specify a `config`. | 
|  | 41 | +    config-repository-dir: "" | 
|  | 42 | + | 
|  | 43 | +    # JSON configuration for commands. | 
|  | 44 | +    config: "" | 
|  | 45 | +``` | 
|  | 46 | +
 | 
|  | 47 | +<!-- end usage --> | 
|  | 48 | +
 | 
|  | 49 | +## Inputs | 
|  | 50 | +
 | 
|  | 51 | +<!-- start inputs --> | 
|  | 52 | +
 | 
|  | 53 | +| **Input**                   | **Description**                                                                                                                                                                                                                                                                | **Default** | **Required** | | 
|  | 54 | +| :-------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------: | :----------: | | 
|  | 55 | +| **`action`**                | The action to be performed. It must be one of the following: "update-open-prs", "update-commit-mappings", "handle-open-prs", "handle-new-mails".                                                                                                                               |             |   **true**   | | 
|  | 56 | +| **`repo-owner`**            | Repository owner.                                                                                                                                                                                                                                                              |             |   **true**   | | 
|  | 57 | +| **`repo-name`**             | Repository name.                                                                                                                                                                                                                                                               |             |   **true**   | | 
|  | 58 | +| **`token`**                 | A repo scoped GitHub Personal Access Token.                                                                                                                                                                                                                                    |             |   **true**   | | 
|  | 59 | +| **`repository-dir`**        | The location of the repository.                                                                                                                                                                                                                                                |             |   **true**   | | 
|  | 60 | +| **`config-repository-dir`** | The location of the repository with gitgitgadget configuration information. This would be used in place of the `config` parameter for the `git` repository. This is normally the gitgitgadget repo with any needed configuration settings. Most users will specify a `config`. |             |  **false**   | | 
|  | 61 | +| **`config`**                | JSON configuration for commands.                                                                                                                                                                                                                                               |             |   **true**   | | 
|  | 62 | + | 
|  | 63 | +<!-- end inputs --> | 
|  | 64 | +<!-- start outputs --> | 
|  | 65 | +<!-- end outputs --> | 
|  | 66 | +<!-- start [.github/ghdocs/examples/] --> | 
|  | 67 | +<!-- end [.github/ghdocs/examples/] --> | 
|  | 68 | + | 
|  | 69 | +## Contributing | 
|  | 70 | + | 
|  | 71 | +### Environment | 
|  | 72 | + | 
|  | 73 | +The rebuild of this document (README.md) expects a `docker` | 
|  | 74 | +command is available from the command line. | 
|  | 75 | + | 
|  | 76 | +### Building | 
|  | 77 | + | 
|  | 78 | +#### action.yml changes | 
|  | 79 | + | 
|  | 80 | +Changes to `action.yml` require rebuilding the `README.md`. This is done | 
|  | 81 | +using `npm run build:readme`. **Note**: markup is very limited in the | 
|  | 82 | +`action.yml`. | 
|  | 83 | + | 
|  | 84 | +#### Source changes | 
|  | 85 | + | 
|  | 86 | +Before making source changes, the `gitgitgadget` package must be built and | 
|  | 87 | +installed. Other packages must also be installed but the | 
|  | 88 | +`gitgitgadget` package is not available on npm. | 
|  | 89 | + | 
|  | 90 | +1. In the `gitgitgadget` repo run `npm pack` to generate the package. | 
|  | 91 | +1. Run `npm install gitgitgadget` to install the package locally. This | 
|  | 92 | +   assumes the two repos are at the same directory level. | 
|  | 93 | + | 
|  | 94 | +Code changes are built using `npm run build`. This builds a new action in the | 
|  | 95 | +`dist` directory. | 
|  | 96 | + | 
|  | 97 | +### Testing | 
|  | 98 | + | 
|  | 99 | +The action supports four different checks. The checks and associated npm | 
|  | 100 | +commands are: | 
|  | 101 | + | 
|  | 102 | +- update-open-prs (test:upr) | 
|  | 103 | +- update-commit-mappings (test:ucm) | 
|  | 104 | +- handle-open-prs (test:hop) | 
|  | 105 | +- handle-new-mails (test:hnm) | 
|  | 106 | + | 
|  | 107 | +A windows command is provided for testing. It requires: | 
|  | 108 | + | 
|  | 109 | +1. A test repo set up to be monitored. A GitHub PAT must already be set as | 
|  | 110 | +   the INPUT_TOKEN environment variable or indentifed in a `.secret` file in | 
|  | 111 | +   the repo. The format of the `.secret` file is `INPUT_TOKEN=<pat>`. | 
|  | 112 | +2. A config describing the test repo. | 
|  | 113 | +3. For testing mail checks, a mail repo must be available with valid email. | 
|  | 114 | + | 
|  | 115 | +The test is run using the command: | 
|  | 116 | + | 
|  | 117 | +``` | 
|  | 118 | +npm run <test-name> <test-repo-owner> <test-repo-name> <config-location> <email-repo-location> | 
|  | 119 | +``` | 
0 commit comments