Skip to content

Add linters #69

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

Merged
merged 1 commit into from
Jul 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ env:

jobs:
test:
if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
if: |-
${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name && github.actor != 'dependabot[bot]' }}
runs-on: 'ubuntu-latest'

steps:
Expand All @@ -35,13 +36,13 @@ jobs:
- id: 'compute-test-uid'
name: 'Compute test UID'
run: |-
echo "TEST_UID=${GITHUB_JOB}-${GITHUB_SHA::7}-${GITHUB_RUN_NUMBER}" >> ${GITHUB_ENV}
echo "TEST_UID=${GITHUB_JOB}-${GITHUB_SHA::7}-${GITHUB_RUN_NUMBER}" >> "${GITHUB_ENV}"

- id: 'set-up-node'
name: 'Set up Node'
uses: 'actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a' # ratchet:actions/setup-node@v4
with:
node-version: '20.x'
node-version-file: 'package.json'

- id: 'build'
name: 'Build'
Expand Down Expand Up @@ -69,7 +70,10 @@ jobs:

- id: 'create-pipeline'
name: 'Create pipeline'
run: 'gcloud deploy apply --file=tests/fixtures/clouddeploy.yaml --region=${REGION}'
run: |-
gcloud deploy apply \
--file="tests/fixtures/clouddeploy.yaml" \
--region="${REGION}"

- id: 'create-release'
name: 'Create release'
Expand All @@ -89,9 +93,12 @@ jobs:

- id: 'report-release'
name: 'Report Cloud Deploy release'
env:
RELEASE_NAME: '${{ steps.create-release.outputs.name }}'
RELEASE_LINK: '${{ steps.create-release.outputs.link }}'
run: |-
echo "Created release: ${{ steps.create-release.outputs.name }}"
echo "Release link: ${{ steps.create-release.outputs.link }}"
echo "Created release: ${RELEASE_NAME}"
echo "Release link: ${RELEASE_LINK}"

- id: 'run-e2e-tests'
name: 'Run Tests'
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,10 @@ jobs:

- uses: 'actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a' # ratchet:actions/setup-node@v4
with:
node-version: '20.x'
node-version-file: 'package.json'

- name: 'npm build'
run: 'npm ci && npm run build'

- name: 'npm lint'
# There's no need to run the linter for each operating system, since it
# will find the same thing 3x and clog up the PR review.
if: ${{ matrix.os == 'ubuntu-latest' }}
run: 'npm run lint'

- name: 'npm test'
run: 'npm run test'
8 changes: 4 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: Create Cloud Deploy Release
author: Google LLC
name: 'Create Cloud Deploy Release'
author: 'Google LLC'
description: |-
Use this action to create a release in Cloud Deploy.

Expand Down Expand Up @@ -112,12 +112,12 @@ inputs:

outputs:
name:
description:
description: |-
The full name of the release in Cloud Deploy, including project and
pipeline names, as well as the chosen name of the release itself.

link:
description:
description: |-
A link to the Cloud Deploy release in the Google Cloud Web Console.

branding:
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
"test": "node --require ts-node/register --test-reporter spec --test ./tests/unit/main.test.ts ./tests/unit/output-parser.test.ts",
"e2e-tests": "node --require ts-node/register --test-reporter spec --test ./tests/e2e.test.ts"
},
"engines": {
"node": "20.x",
"npm": "10.x"
},
"repository": {
"type": "git",
"url": "https://github.com/google-github-actions/create-cloud-deploy-release.git"
Expand Down
8 changes: 5 additions & 3 deletions tests/fixtures/clouddeploy.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ metadata:
description: 'Deployment pipeline for GitHub Action tests'
serialPipeline:
stages:
- targetId: 'gha-test-target'
profiles: ['gha-test']
- targetId: 'gha-test-target'
profiles: ['gha-test']

# yamllint disable-line rule:document-start
---
apiVersion: deploy.cloud.google.com/v1
apiVersion: 'deploy.cloud.google.com/v1'
kind: 'Target'
metadata:
name: 'gha-test-target'
Expand Down
4 changes: 2 additions & 2 deletions tests/fixtures/gha-test-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
template:
spec:
containers:
- name: 'gha-test-app'
image: 'gha-test-app'
- name: 'gha-test-app'
image: 'gha-test-app'
scaling:
maxInstanceCount: '1'
8 changes: 4 additions & 4 deletions tests/fixtures/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ kind: 'Config'
metadata:
name: 'gha-test'
profiles:
- name: 'gha-test'
manifests:
rawYaml:
- 'gha-test-app.yaml'
- name: 'gha-test'
manifests:
rawYaml:
- 'gha-test-app.yaml'
deploy:
cloudrun: {}
Loading