Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ruairi-hayes authored Dec 15, 2023
1 parent aeeb040 commit 0e4c080
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ The following parameters are always required:
- API_FILES - One or more file names of the APIs to sync with apiconnect discovery repo separated by comma.<br /> &nbsp; Example : `gmail-api.json,gmail-api.yaml,mit-api.json,APIfolder/petstore-exp.json`
- API_FOLDERS - One or more folder names containing APIs to sync with apiconnect discovery repo separated by comma. <br /> &nbsp; Example : `APIFiles,APIFolders`
- resync_check: Indicates if changes to the action like at initial creation should trigger a api-file sync.
- git_diff: (Optional) Git diff between the current and the previous commit. Use suppose multiple files change in the commit and run workflow only if the supplied file changes.
- git_diff: (Optional) Git diff between the current and the previous commit. If multiple files have changed in the commit then the workflow will run only if one of the files supplied in `API_FILES` or `API_FOLDERS` has changed.
- apikey - An API Key can be obtained from the api-manager for the user who have access to post teh API.<br />
&nbsp; Get the API key from the APIC Manager from the link in the following structure - `http://{api-host}/manager/auth/manager/sign-in/?from=TOOLKIT` (typically used with an OIDC user registry like IBM Verify). It is good practice to store any sensitive data like the apikey as a github action secret. See [here](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) for more details. For the sample below the github secret should be called `apicApikey` as it will need to match the following templated value ${{ secrets.apicApikey }}

The format of the API documents can be json or yaml. Among the parameters used, either `API_FILES` or `API_FOLDERS` needs to be supplied according to how the API documents are send. The APIs can be sent to the API connect discovery service in any one of the following type - single/multiple documents or folder/folders with APIs documents in it. Single and multiple documents will be supplied through `API_FILES` param and single and multiple folders with many API files inside will be supplied through `API_FOLDERS` param.<br />
The format of the API documents can be json or yaml. Among the parameters used, either `API_FILES` or `API_FOLDERS` needs to be supplied according to how the API documents are sent. The APIs can be sent to the API connect discovery service in any one of the following ways - single/multiple documents or folder/folders with APIs documents in it. Single and multiple documents will be supplied through `API_FILES` param and single and multiple folders with many API files inside will be supplied through `API_FOLDERS` param.<br />
To send the documents, create the workflow in your GitHub repository similar to one of the samples below

To create the workflow action in your github repository do the following
Expand Down Expand Up @@ -68,9 +68,9 @@ jobs:
```

In the above yml content, env and jobs are described to send API documents.<br />
The job works as follows, where on a push commit to the github repo the specified `api_files` will be sent to the discovery service repo of the given `provider_org` at location `api_host` using the `api_key` to authenticate with the discovery service.<br />
The job is also sending the git diff of the files from the previous commit and the current one where the discovery action will verufy whether any of the changed files include files supplied.<br />
`API_FILES` can be replaced with `API_FOLDERS` when the entire folder/folders needs to be sent. This can be used when the git push have multiple files and need to run the workflow when any of the supplied file changed.
The job works as follows, on a push commit to the github repo the specified `api_files` will be sent to the discovery service repo of the given `provider_org` at location `api_host` using the `api_key` to authenticate with the discovery service.<br />
The job will send the git diff of the files between the previous commit and the current commit and the discovery action will verify whether any of the changed files include files supplied in `API_FILES` or `API_FOLDERS`.<br />
`API_FILES` can be replaced with `API_FOLDERS` when the entire folder/folders needs to be sent. This can be used when the git push has multiple files and needs to run the workflow when any of the supplied file changed.

```
name: Sync Discovered API with ApiConnect
Expand Down

0 comments on commit 0e4c080

Please sign in to comment.