Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update readme when a new release is available #548

Merged
merged 13 commits into from
Nov 28, 2024
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,46 @@ More about how the upstream action works can be found [here](https://github.com/
### Add new components to Release Please config file

In order for components to be released, they must be in the [release-please-config.json](./release-please-config.json) file. Always ensure new components are added to this file.

`README` files for each component should have embedded versions updated every time there is a new release.

Add a new entry which looks like this:

```json
"packages": {
"actions/my-new-action": {
"package-name": "my-new-action",
"extra-files": ["README.md"]
},
}
```

Also, the following block should be added in the README file which will be responsible for updating the version with a new one:

`README.md`:

````markdown
# my-new-action

This is my new action which does awesome stuff!

<!-- x-release-please-start-version -->

```yaml
name: My new action
on:
pull_request:

jobs:
my-new-action:
runs-on: ubuntu-latest

steps:
- id: do-stuff
uses: grafana/shared-workflows/actions/[email protected]
```

<!-- x-release-please-end-version -->
````

Every semver-like string between the `x-release-please-start-version` and `x-release-please-end-version` comments will be updated with the new version whenever the component is released.
16 changes: 16 additions & 0 deletions actions/argo-lint/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Lint Argo

Shared workflow to lint Argo workflow files.

## Example

<!-- x-release-please-start-version -->

```
uses: grafana/shared-workflows/actions/[email protected]
with:
path: /path/to/files # Paths to files for linting

```

<!-- x-release-please-end-version -->
6 changes: 5 additions & 1 deletion actions/aws-auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ This is a composite GitHub Action used to authenticate and access resources in A

Example usage in a repository:

<!-- x-release-please-start-version -->

```yaml
name: Authenticate to AWS
on:
Expand All @@ -18,7 +20,7 @@ jobs:

steps:
- id: aws-auth
uses: grafana/shared-workflows/actions/aws-auth@main
uses: grafana/shared-workflows/actions/aws-auth@argo-lint-v1.0.0
with:
aws-region: "us-west-1"
role-arn: "arn:aws:iam::366620023056:role/github-actions/s3-test-access"
Expand All @@ -31,6 +33,8 @@ jobs:
cat 'test.txt'
```

<!-- x-release-please-end-version -->

## Inputs

<!-- markdownlint-disable no-space-in-code -->
Expand Down
6 changes: 5 additions & 1 deletion actions/build-push-to-dockerhub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ It uses `get-vault-secrets` action to get the DockerHub username and password fr

Example of how to use this action in a repository:

<!-- x-release-please-start-version -->

```yaml
name: Push to DockerHub
on:
Expand All @@ -23,7 +25,7 @@ jobs:
uses: actions/checkout@v4

- id: push-to-dockerhub
uses: grafana/shared-workflows/actions/build-push-to-dockerhub@main
uses: grafana/shared-workflows/actions/build-push-to-dockerhub@build-push-to-dockerhub-v0.1.0
with:
repository: ${{ github.repository }} # or any other dockerhub repository
context: .
Expand All @@ -32,6 +34,8 @@ jobs:
"latest"
```

<!-- x-release-please-end-version -->

## Inputs

| Name | Type | Description |
Expand Down
6 changes: 5 additions & 1 deletion actions/dockerhub-login/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ It uses `get-vault-secrets` action to get the DockerHub username and password fr

Example of how to use this action in a repository:

<!-- x-release-please-start-version -->

```yaml
name: Push to DockerHub
on:
Expand All @@ -20,7 +22,9 @@ jobs:

steps:
- name: Login to DockerHub
uses: grafana/shared-workflows/actions/dockerhub-login@main
uses: grafana/shared-workflows/actions/dockerhub-login@dockerhub-login-v1.0.0
- name: Build and push
run: make build && make push
```

<!-- x-release-please-end-version -->
6 changes: 5 additions & 1 deletion actions/generate-openapi-clients/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ _Note: For now, it only generates Go code. But it's structured in a way that any

## Example workflow

<!-- x-release-please-start-version -->

```yaml
name: Generate Clients

Expand All @@ -38,13 +40,15 @@ jobs:
with:
go-version: 1.18
- name: Generate clients
uses: grafana/shared-workflows/actions/generate-openapi-clients@main
uses: grafana/shared-workflows/actions/generate-openapi-clients@generate-openapi-clients-v1.0.0
with:
package-name: slo
spec-path: openapi.yaml
modify-spec-script: .github/workflows/modify-spec.sh # Optional, see "Spec Modifications" section
```

<!-- x-release-please-end-version -->

### Spec Modifications at Runtime

The `modify-spec-script` attribute is the path to an executable script that modifies the OpenAPI spec before generating the client.
Expand Down
6 changes: 5 additions & 1 deletion actions/get-vault-secrets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The secret format is defined here: <https://github.com/hashicorp/vault-action>

Example workflow:

<!-- x-release-please-start-version -->

```yaml
name: CI
on:
Expand All @@ -21,7 +23,7 @@ jobs:

steps:
- id: get-secrets
uses: grafana/shared-workflows/actions/get-vault-secrets@main
uses: grafana/shared-workflows/actions/get-vault-secrets@get-vault-secrets-v1.0.1
with:
# Secrets placed in the ci/common/<path> path in Vault
common_secrets: |
Expand All @@ -37,3 +39,5 @@ jobs:
echo "$ENVVAR1"
echo "${{ env.ENVVAR2 }}"
```

<!-- x-release-please-end-version -->
6 changes: 5 additions & 1 deletion actions/login-to-gar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ This is a composite GitHub Action, used to login to Google Artifact Registry (GA
It uses [OIDC authentication](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
which means that only workflows which get triggered based on certain rules can trigger these composite workflows.

<!-- x-release-please-start-version -->

```yaml
name: CI
on:
Expand All @@ -19,9 +21,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: grafana/shared-workflows/actions/login-to-gar@main
- uses: grafana/shared-workflows/actions/login-to-gar@login-to-gar-v0.1.0
id: login-to-gar
with:
registry: "<YOUR-GAR>" # e.g. us-docker.pkg.dev
environment: "prod" # can be either dev/prod
```

<!-- x-release-please-end-version -->
6 changes: 5 additions & 1 deletion actions/login-to-gcs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ It uses [OIDC authentication](https://docs.github.com/en/actions/deployment/secu
which means that only workflows which get triggered based on certain rules can
trigger these composite workflows.

<!-- x-release-please-start-version -->

```yaml
name: Login-to-gcs

Expand All @@ -21,10 +23,12 @@ jobs:
login-to-gcs:
name: login-to-gcs
steps:
- uses: grafana/shared-workflows/actions/login-to-gcs@main
- uses: grafana/shared-workflows/actions/login-to-gcs@login-to-gcs-v0.1.0
id: login-to-gcs
```

<!-- x-release-please-end-version -->

You can now use the shared-workflow `push-to-gcs` or gcloud to push objects from your CI pipeline.

Ex:
Expand Down
6 changes: 5 additions & 1 deletion actions/push-to-gar-docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ It uses [OIDC authentication](https://docs.github.com/en/actions/deployment/secu
which means that only workflows which get triggered based on certain rules can
trigger these composite workflows.

<!-- x-release-please-start-version -->

```yaml
name: CI
on:
Expand All @@ -24,7 +26,7 @@ jobs:
uses: actions/checkout@v4

- id: push-to-gar
uses: grafana/shared-workflows/actions/push-to-gar-docker@main
uses: grafana/shared-workflows/actions/push-to-gar-docker@push-to-gar-docker-v0.1.0
with:
registry: "<YOUR-GAR>" # e.g. us-docker.pkg.dev, optional
tags: |-
Expand All @@ -35,6 +37,8 @@ jobs:
environment: "dev" # can be either dev/prod
```

<!-- x-release-please-end-version -->

[Artifact Registry repositories can't contain underscores][underscore-issue].
As a convention, this action will replace any underscores in the repository name
with hyphens. That behaviour can be overridden using the `repository_name`
Expand Down
28 changes: 16 additions & 12 deletions actions/push-to-gcs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ It uses [OIDC authentication](https://docs.github.com/en/actions/deployment/secu
which means that only workflows which get triggered based on certain rules can
trigger these composite workflows.

<!-- x-release-please-start-version -->

```yaml
name: Upload Files to GCS

Expand All @@ -27,83 +29,85 @@ jobs:
id: login-to-gcs

# Upload a single file to the bucket root
- uses: grafana/shared-workflows/actions/push-to-gcs@main
- uses: grafana/shared-workflows/actions/push-to-gcs@push-to-gcs-v0.1.0
with:
bucket: ${{ steps.login-to-gcs.outputs.bucket }}
path: file.txt
environment: "dev" # Can be dev/prod (defaults to dev)

# Upload a single file and apply a predefined ACL. See `predefinedAcl` for options.
- uses: grafana/shared-workflows/actions/push-to-gcs@main
- uses: grafana/shared-workflows/actions/push-to-gcs@push-to-gcs-v0.1.0
with:
bucket: ${{ steps.login-to-gcs.outputs.bucket }}
path: file.txt
predefinedAcl: projectPrivate
environment: "dev"

# Here are 3 equivalent statements to upload a single file and its parent directory to the bucket root
- uses: grafana/shared-workflows/actions/push-to-gcs@main
- uses: grafana/shared-workflows/actions/push-to-gcs@push-to-gcs-v0.1.0
with:
bucket: ${{ steps.login-to-gcs.outputs.bucket }}
path: folder/file.txt
- uses: grafana/shared-workflows/actions/push-to-gcs@main
- uses: grafana/shared-workflows/actions/push-to-gcs@push-to-gcs-v0.1.0
with:
bucket: ${{ steps.login-to-gcs.outputs.bucket }}
path: .
glob: "folder/file.txt"
- uses: grafana/shared-workflows/actions/push-to-gcs@main
- uses: grafana/shared-workflows/actions/push-to-gcs@push-to-gcs-v0.1.0
with:
bucket: ${{ steps.login-to-gcs.outputs.bucket }}
path: folder
glob: "file.txt"

# Here are 2 equivalent statements to upload a single file WITHOUT its parent directory to the bucket root
- uses: grafana/shared-workflows/actions/push-to-gcs@main
- uses: grafana/shared-workflows/actions/push-to-gcs@push-to-gcs-v0.1.0
with:
bucket: ${{ steps.login-to-gcs.outputs.bucket }}
path: folder/file.txt
parent: false
- uses: grafana/shared-workflows/actions/push-to-gcs@main
- uses: grafana/shared-workflows/actions/push-to-gcs@push-to-gcs-v0.1.0
with:
bucket: ${{ steps.login-to-gcs.outputs.bucket }}
path: folder
glob: "file.txt"
parent: false

# Here are 2 equivalent statements to upload a directory with all subdirectories
- uses: grafana/shared-workflows/actions/push-to-gcs@main
- uses: grafana/shared-workflows/actions/push-to-gcs@push-to-gcs-v0.1.0
with:
bucket: ${{ steps.login-to-gcs.outputs.bucket }}
path: folder/
- uses: grafana/shared-workflows/actions/push-to-gcs@main
- uses: grafana/shared-workflows/actions/push-to-gcs@push-to-gcs-v0.1.0
with:
bucket: ${{ steps.login-to-gcs.outputs.bucket }}
path: .
glob: "folder/**/*"

# Specify a bucket prefix with `bucket_path`
- uses: grafana/shared-workflows/actions/push-to-gcs@main
- uses: grafana/shared-workflows/actions/push-to-gcs@push-to-gcs-v0.1.0
name: upload-yaml-to-some-path
with:
bucket: ${{ steps.login-to-gcs.outputs.bucket }}
path: file.txt
bucket_path: some-path/

# Upload all files of a type
- uses: grafana/shared-workflows/actions/push-to-gcs@main
- uses: grafana/shared-workflows/actions/push-to-gcs@push-to-gcs-v0.1.0
with:
bucket: ${{ steps.login-to-gcs.outputs.bucket }}
path: folder/
glob: "*.txt"

# upload all files of a type recursively
- uses: grafana/shared-workflows/actions/push-to-gcs@main
- uses: grafana/shared-workflows/actions/push-to-gcs@push-to-gcs-v0.1.0
with:
bucket: ${{ steps.login-to-gcs.outputs.bucket }}
path: folder/
glob: "**/*.txt"
```

<!-- x-release-please-end-version -->

## Inputs

| Name | Type | Description |
Expand Down
Loading
Loading