diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..2e2b29a7 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,22 @@ +version: 2 +updates: + - package-ecosystem: bundler + directory: "/" + schedule: + interval: weekly + cooldown: + semver-major-days: 7 + semver-minor-days: 3 + semver-patch-days: 2 + default-days: 7 + + - package-ecosystem: github-actions + directory: "/" + groups: + github-actions: + patterns: + - "*" + schedule: + interval: weekly + cooldown: + default-days: 7 diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index cd09b729..a275fb01 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -1,10 +1,18 @@ name: CI -on: [ push, pull_request ] +on: + push: + branches: [ master ] + pull_request: + types: [ opened, synchronize ] + +permissions: {} jobs: tests: runs-on: ubuntu-latest + permissions: + contents: read strategy: fail-fast: false matrix: @@ -25,15 +33,18 @@ jobs: rubygems_version: '3.6.9' name: Ruby ${{ matrix.ruby }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 + with: + persist-credentials: false - name: Set up Ruby - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@afeafc3d1ab54a631816aba4c914a0081c12ff2f # v1.310.0 with: ruby-version: ${{ matrix.ruby }} - name: Update RubyGems env: RUBYGEMS_VERSION: ${{ matrix.rubygems_version }} run: | + # shellcheck disable=SC2086 # empty version is intentional: no arg means update to latest gem update --system ${RUBYGEMS_VERSION:-} gem -v - name: Install dependencies @@ -44,13 +55,36 @@ jobs: # rubocop linting rubocop: runs-on: ubuntu-latest + permissions: + contents: read steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 + with: + persist-credentials: false - name: Set up Ruby - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@afeafc3d1ab54a631816aba4c914a0081c12ff2f # v1.310.0 with: ruby-version: 2.7 - name: Install dependencies run: bundle install --jobs 4 --retry 3 - name: Run rubocop run: bundle exec rubocop --parallel + + lint-actions: + name: GitHub Actions audit + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 + with: + persist-credentials: false + + - name: Run actionlint + uses: rhysd/actionlint@393031adb9afb225ee52ae2ccd7a5af5525e03e8 # v1.7.11 + + - name: Run zizmor + uses: zizmorcore/zizmor-action@71321a20a9ded102f6e9ce5718a2fcec2c4f70d8 # v0.5.2 + with: + advanced-security: false