diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..563c6a33 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,27 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "pip" + directory: "/" # pyproject.toml + schedule: + interval: "daily" + commit-message: + prefix: "chore" + include: "scope" + labels: + - "dependencies" + - package-ecosystem: "github-actions" + # Workflow files stored in the + # default location of `.github/workflows` + directory: "/" + schedule: + interval: "daily" + commit-message: + prefix: "chore" + include: "scope" + labels: + - "dependencies" diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..1eb315e8 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,67 @@ +# https://codeql.github.com/ +name: CodeQL + +on: + push: + paths: + - "**.js" + - "**.py" + pull_request: + branches: [main] + paths: + - "**.js" + - "**.py" + schedule: + - cron: "24 9 * * 6" + +jobs: + setup: + name: Set up CodeQL analysis + runs-on: ubuntu-latest + # Required permissions + permissions: + pull-requests: read + outputs: + # changes is a JSON array with names of all filters matching any of the changed files + languages: ${{ steps.filter.outputs.changes }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + javascript: "**.js" + python: "**.py" + + codeql: + name: CodeQL Analyze + runs-on: ubuntu-latest + needs: setup + if: ${{ needs.setup.outputs.languages != '[]' }} + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + # Parse JSON array containing names of all filters matching any of changed files + # e.g. ['javascript', 'python'] if both file types had changes + language: ${{ fromJSON(needs.setup.outputs.languages) }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + # https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning#specifying-configuration-details-using-the-config-input + config: | + paths-ignore: + - tests + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/dependency-triage.yml b/.github/workflows/dependency-triage.yml new file mode 100644 index 00000000..cf3f489c --- /dev/null +++ b/.github/workflows/dependency-triage.yml @@ -0,0 +1,24 @@ +name: "Dependency PR triage" + +on: + pull_request: + types: [opened] + +jobs: + dependency-triage: + runs-on: ubuntu-latest + # see https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#responding-to-events + if: github.actor == 'dependabot[bot]' || github.actor == 'pre-commit-ci[bot]' + steps: + - uses: actions/add-to-project@main + with: + project-url: https://github.com/orgs/compiler/projects/${{ vars.GH_PROJECT }} + github-token: ${{ secrets.GH_PROJECTS_TOKEN }} + + - uses: EndBug/project-fields@v2 + with: + operation: set + fields: Effort,Status + values: 1,In review + project_url: https://github.com/orgs/compiler/projects/${{ vars.GH_PROJECT }} + github_token: ${{ secrets.GH_PROJECTS_TOKEN }} diff --git a/.github/workflows/labeler-actions.yml b/.github/workflows/labeler-actions.yml new file mode 100644 index 00000000..ecc5cd7f --- /dev/null +++ b/.github/workflows/labeler-actions.yml @@ -0,0 +1,17 @@ +name: Label actions + +on: + pull_request: + types: [opened] + paths: + - ".github/dependabot.yml" + - ".github/workflows/**" + +jobs: + label-actions: + runs-on: ubuntu-latest + steps: + - name: add-label + uses: andymckay/labeler@master + with: + add-labels: "actions" diff --git a/.github/workflows/labeler-docs.yml b/.github/workflows/labeler-docs.yml new file mode 100644 index 00000000..87905019 --- /dev/null +++ b/.github/workflows/labeler-docs.yml @@ -0,0 +1,19 @@ +name: Label docs + +on: + pull_request: + branches: [main] + types: [opened] + paths: + - "docs/**" + - "mkdocs.yml" + - ".github/workflows/mkdocs.yml" + +jobs: + label-docs: + runs-on: ubuntu-latest + steps: + - name: add-label + uses: andymckay/labeler@master + with: + add-labels: "documentation"