Skip to content

Commit

Permalink
GitHub: Expand yaml-lint.yml (#6571)
Browse files Browse the repository at this point in the history
  • Loading branch information
beqqrry-aws authored Jun 20, 2024
1 parent 8d09dbd commit f60de44
Show file tree
Hide file tree
Showing 22 changed files with 75 additions and 80 deletions.
1 change: 0 additions & 1 deletion .github/allowed-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,3 @@
- name: Text Review not needed
color: "f5f7f9"
description: "This contains no text which needs review"

2 changes: 1 addition & 1 deletion .github/linters/.ruby-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ Layout/LineLength:
Naming/FileName:
Enabled: false
Style/HashSyntax:
EnforcedShorthandSyntax: either
EnforcedShorthandSyntax: either
4 changes: 2 additions & 2 deletions .github/workflows/docker-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ permissions:
contents: read
id-token: write

on:
on: # yamllint disable-line rule:truthy
pull_request_target:
types:
- closed
Expand All @@ -30,7 +30,7 @@ jobs:
##################################################

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@master # More information on this action can be found below in the 'AWS Credentials' section
uses: aws-actions/configure-aws-credentials@master # More information on this action can be found below in the 'AWS Credentials' section
with:
role-to-assume: arn:aws:iam::808326389482:role/automation
aws-region: us-east-1
Expand Down
42 changes: 21 additions & 21 deletions .github/workflows/issue-metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# https://github.com/marketplace/actions/issue-metrics

name: Monthly issue metrics
on:
on: # yamllint disable-line rule:truthy
workflow_dispatch:
schedule:
- cron: '3 2 1 * *'
Expand All @@ -20,27 +20,27 @@ jobs:
name: Issue metrics
runs-on: ubuntu-latest
steps:
- name: Get dates for last month
shell: bash
run: |
# Calculate the first day of the previous month
first_day=$(date -d "last month" +%Y-%m-01)
- name: Get dates for last month
shell: bash
run: |
# Calculate the first day of the previous month
first_day=$(date -d "last month" +%Y-%m-01)
# Calculate the last day of the previous month
last_day=$(date -d "$first_day +1 month -1 day" +%Y-%m-%d)
# Calculate the last day of the previous month
last_day=$(date -d "$first_day +1 month -1 day" +%Y-%m-%d)
#Set an environment variable with the date range
echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV"
# Set an environment variable with the date range
echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV"
- name: Run issue-metrics tool
uses: github/issue-metrics@v2
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEARCH_QUERY: 'repo:awsdocs/aws-doc-sdk-examples is:issue created:${{ env.last_month }} -reason:"not planned"'
- name: Run issue-metrics tool
uses: github/issue-metrics@v2
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEARCH_QUERY: 'repo:awsdocs/aws-doc-sdk-examples is:issue created:${{ env.last_month }} -reason:"not planned"'

- name: Create issue
uses: peter-evans/create-issue-from-file@v5
with:
title: Monthly issue metrics report ${{ env.last_month }}
token: ${{ secrets.GITHUB_TOKEN }}
content-filepath: ./issue_metrics.md
- name: Create issue
uses: peter-evans/create-issue-from-file@v5
with:
title: Monthly issue metrics report ${{ env.last_month }}
token: ${{ secrets.GITHUB_TOKEN }}
content-filepath: ./issue_metrics.md
8 changes: 3 additions & 5 deletions .github/workflows/label-auditor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "Audit Labels"

on:
on: # yamllint disable-line rule:truthy
workflow_dispatch:
pull_request:
branches:
Expand All @@ -16,8 +16,7 @@ jobs:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v3
with:
sparse-checkout: .github/allowed-labels.yml
Expand All @@ -31,8 +30,7 @@ jobs:
#
# For more information, see:
# https://github.com/crazy-max/ghaction-github-labeler
-
name: Audit Labels
- name: Audit Labels
if: success()
uses: crazy-max/ghaction-github-labeler@v4
with:
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/label-auto-language.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "Auto Labeler"

on:
on: # yamllint disable-line rule:truthy
pull_request_target:
branches:
- main
Expand All @@ -12,8 +12,7 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout repository
uses: actions/checkout@v3

# The Add Labels workflow adds a label to pull requests
Expand All @@ -24,9 +23,8 @@ jobs:
#
# For more information, see:
# https://github.com/actions/labeler
-
name: Add Labels
uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/label-ruleset.yml
- name: Add Labels
uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/label-ruleset.yml
4 changes: 1 addition & 3 deletions .github/workflows/label-checker.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
name: Label Checker
on:
on: # yamllint disable-line rule:truthy
pull_request:
branches:
- main
Expand All @@ -12,7 +11,6 @@ on:
- unlabeled

jobs:

check_oncall_labels:
name: Check On Call Review labels
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Dotnet lint check
on:
name: Dotnet Lint and Check

on: # yamllint disable-line rule:truthy
pull_request:
workflow_dispatch:
permissions:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: golangci-lint
on:
name: Lint GoLang

on: # yamllint disable-line rule:truthy
pull_request:
workflow_dispatch:
permissions:
Expand Down Expand Up @@ -29,7 +30,6 @@ jobs:
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.47.3
- name: run golangci-lint
if: steps.changed-files.outputs.any_changed == 'true'
# If you get a linting error of "File is not `goimports`-ed", the solution is to run "gofmt -w ./<folder>".
run: |
run: | # If you get a linting error of "File is not `goimports`-ed", the solution is to run "gofmt -w ./<folder>".
cd gov2
./lint_all_go.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: JavaScript

on:
on: # yamllint disable-line rule:truthy
pull_request:
workflow_dispatch:

Expand Down Expand Up @@ -36,4 +36,4 @@ jobs:
if: steps.changed-files.outputs.any_changed == 'true'
run: |
changed_files=(${{steps.changed-files.outputs.all_changed_files}})
./javascriptv3/github_scripts/lint.sh "${changed_files[@]}"
./javascriptv3/github_scripts/lint.sh "${changed_files[@]}"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Kotlin Linter

on:
on: # yamllint disable-line rule:truthy
workflow_dispatch:
pull_request:

Expand All @@ -12,7 +12,7 @@ jobs:
- name: Checkout files
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41
Expand All @@ -34,4 +34,3 @@ jobs:
run: |
ktlint --reporter=plain?group_by_file --editorconfig=".github/linters/ktlint_config"
continue-on-error: false

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: "PHP Linter"

on:
on: # yamllint disable-line rule:truthy
workflow_dispatch:
pull_request:
paths:
- "**.php"
Expand All @@ -12,7 +13,8 @@ jobs:
name: "PHP Linter"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0

Expand All @@ -28,7 +30,8 @@ jobs:
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
php phpcs.phar --version
- uses: thenabeel/action-phpcs@v8
- name: Run PHPCS
uses: thenabeel/action-phpcs@v8
if: steps.changed-files.outputs.any_changed == 'true'
with:
files: "**.php"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Lint Python

on:
on: # yamllint disable-line rule:truthy
pull_request:
workflow_dispatch:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Ruby Linting

on:
on: # yamllint disable-line rule:truthy
pull_request:
workflow_dispatch:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Rust
on:
name: Lint - Test - Format Rust

on: # yamllint disable-line rule:truthy
pull_request:
workflow_dispatch:
permissions:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr_stats.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Pull Request Stats

on:
on: # yamllint disable-line rule:truthy
workflow_dispatch:

jobs:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sd-cpp-lint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "cpp lint check"
on:
name: "Lint C++"
on: # yamllint disable-line rule:truthy
pull_request:
workflow_dispatch:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sh-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

name: Lint Bash

on:
on: # yamllint disable-line rule:truthy
pull_request:
workflow_dispatch:

Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/validate-doc-metadata.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
name: Validate Documentation Metadata

on:
on: # yamllint disable-line rule:truthy
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]

# Allows running this workflow manually from the Actions tab
workflow_dispatch:

jobs:
validate-doc-metadata:
name: Validate Doc Metadata
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/writeme.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Validate WRITEMEs

# Controls when the action will run.
on:
on: # yamllint disable-line rule:truthy
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [main]
Expand All @@ -21,12 +21,12 @@ jobs:

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: checkout repo content
uses: actions/checkout@v3 # checkout the repository content to github runner.
- name: setup python
- name: Checkout repo content
uses: actions/checkout@v3 # checkout the repository content to github runner.
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: 3.11 #install the python needed
python-version: 3.11 # install the python needed
- name: Install dependencies
run: >-
python3 -m pip install -r .tools/readmes/requirements.txt
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/yaml-lint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Lint Metadata Yaml
name: Lint Yaml

on:
on: # yamllint disable-line rule:truthy
pull_request:
workflow_dispatch:

Expand All @@ -20,7 +20,7 @@ jobs:
id: changed-files
uses: tj-actions/changed-files@v41
with:
files: ".doc_gen/metadata/**/*.{yml,yaml}"
files: "**/*.{yml,yaml}"
- name: Setup Python
if: steps.changed-files.outputs.any_changed == 'true'
uses: actions/setup-python@v3
Expand All @@ -30,7 +30,7 @@ jobs:
if: steps.changed-files.outputs.any_changed == 'true'
run: >-
python3 -m pip install -r .tools/base_requirements.txt
- name: Lint metadata files
- name: Lint YAML files
if: steps.changed-files.outputs.any_changed == 'true'
run: >-
yamllint --format standard -c .tools/validation/.yamllint.yaml .doc_gen/metadata
yamllint --format standard -c .tools/validation/.yamllint.yaml .
4 changes: 2 additions & 2 deletions .tools/test/stacks/config/targets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ javascriptv3:
account_id: "875008041426"
status: "enabled"
javav2:
account_id: "667348412466" # back-up "814548047983"
account_id: "667348412466" # back-up "814548047983"
status: "enabled"
kotlin:
account_id: "471951630130" # back-up "814548047983"
account_id: "471951630130" # back-up "814548047983"
status: "enabled"
php:
account_id: "733931915187"
Expand Down

0 comments on commit f60de44

Please sign in to comment.