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(ci): create a pipeline for linting YAML workflow files #2183

Merged

Conversation

nicomiguelino
Copy link
Contributor

@nicomiguelino nicomiguelino commented Dec 31, 2024

Description

Created a workflow file for linting GitHub Actions workflow files during pull requests and pushes to master.

Checklist

  • I have performed a self-review of my own code.
  • New and existing unit tests pass locally and on CI with my changes.
  • I have done an end-to-end test for Raspberry Pi devices.
  • I have tested my changes for x86 devices.
  • I added a documentation for the changes I have made (when necessary).

Additional Information

Include any additional information that you think is necessary for this pull request, including screenshots of the changes that you have made.

@nicomiguelino nicomiguelino marked this pull request as ready for review January 1, 2025 04:59
@nicomiguelino nicomiguelino requested a review from a team as a code owner January 1, 2025 04:59
Copy link
Contributor Author

@nicomiguelino nicomiguelino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did a self-review

.github/workflows/build-webview.yaml Outdated Show resolved Hide resolved
.github/workflows/deploy-website.yaml Outdated Show resolved Hide resolved
@nicomiguelino
Copy link
Contributor Author

@CodiumAI-Agent /review

@CodiumAI-Agent
Copy link

CodiumAI-Agent commented Jan 21, 2025

PR Reviewer Guide 🔍

(Review updated until commit 0aeae7b)

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Possible Syntax Issue

Ensure that the added echo commands for setting BALENA_IMAGE in the $GITHUB_ENV are correctly formatted and do not introduce syntax errors or unexpected behavior.

  echo "BALENA_IMAGE=raspberry-pi" >> "$GITHUB_ENV"
elif [ "${{ matrix.board }}" == 'pi2' ]; then
  echo "BALENA_IMAGE=raspberry-pi2" >> "$GITHUB_ENV"
elif [ "${{ matrix.board }}" == 'pi3' ]; then
  echo "BALENA_IMAGE=raspberrypi3" >> "$GITHUB_ENV"
elif [ "${{ matrix.board }}" == 'pi4' ]; then
  echo "BALENA_IMAGE=raspberrypi4-64" >> "$GITHUB_ENV"
elif [ "${{ matrix.board }}" == 'pi5' ]; then
  echo "BALENA_IMAGE=raspberrypi5" >> "$GITHUB_ENV"
Deprecated Syntax Update

Verify that the replacement of ::set-output with appending to $GITHUB_OUTPUT works as intended and does not break the workflow.

{
  echo "buildx_args=--cache-from \"screenly/ose-qt-builder:latest\" \
  --output \"type=image,push=true\" \
  --build-arg \"BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')\" \
  --build-arg \"GIT_HASH=$GITHUB_SHA\" \
  --build-arg \"GIT_SHORT_HASH=$(git rev-parse --short HEAD)\" \
  --build-arg \"GIT_BRANCH=$GITHUB_REF_NAME\""
} >> "$GITHUB_OUTPUT"
New Workflow Addition

Validate the newly added lint-workflows.yml file for its intended functionality, ensuring it correctly lints all YAML workflow files and handles errors gracefully.

name: Lint GitHub Workflows

on:
  pull_request:
    branches:
      - master
    paths:
      - '**/*.yml'
      - '**/*.yaml'
      - '.github/workflows/lint-workflows.yml'
  push:
    branches:
      - master
    paths:
      - '**/*.yml'
      - '**/*.yaml'
      - '.github/workflows/lint-workflows.yml'

jobs:
  actionlint:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Install actionlint
        run: |
          bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
        shell: bash

      - name: Run actionlint
        run: ./actionlint -color
        shell: bash

@CodiumAI-Agent
Copy link

Persistent review updated to latest commit 79a194e

@CodiumAI-Agent
Copy link

Persistent review updated to latest commit 0aeae7b

@nicomiguelino nicomiguelino merged commit 7605f5b into Screenly:master Jan 23, 2025
8 checks passed
@nicomiguelino nicomiguelino deleted the create-workflow-linter-pipeline branch January 24, 2025 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants