From 6e8c13e2aa42a91a4904c5a13024d8bce4ffec64 Mon Sep 17 00:00:00 2001 From: Eric Schultz Date: Mon, 14 Dec 2020 16:58:02 -0600 Subject: [PATCH] Add autoupdating of NOTICE-js and NOTICE-ruby --- .github/workflows/dependabot-js.yml | 61 +++++++++++++++++++++++++++ .github/workflows/dependabot-ruby.yml | 59 ++++++++++++++++++++++++++ 2 files changed, 120 insertions(+) create mode 100644 .github/workflows/dependabot-js.yml create mode 100644 .github/workflows/dependabot-ruby.yml diff --git a/.github/workflows/dependabot-js.yml b/.github/workflows/dependabot-js.yml new file mode 100644 index 00000000..23dfa5be --- /dev/null +++ b/.github/workflows/dependabot-js.yml @@ -0,0 +1,61 @@ +# License: LGPL-3.0-or-later +name: Dependabot JS +env: + node: 14.6.0 + os: ubuntu-latest +on: + pull_request: + paths: + - yarn.lock +jobs: + dependabot: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + node: [14.6.0] + ruby: [2.6.6] + if: github.actor == 'dependabot[bot]' + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.NOTICE_WORKER_PAT }} + - uses: actions/setup-node@v1.4.4 + with: + node-version: ${{ matrix.node }} + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v2 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ matrix.os }}-yarn-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ matrix.os }}-yarn-${{ matrix.node }}- + - run: yarn install --frozen-lockfile + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - uses: actions/cache@v2 + name: Use Gem cache + with: + path: vendor/bundle + key: bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/Gemfile.lock') }} + restore-keys: | + bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby }}- + - run: | + bundle config deployment true + bundle config path vendor/bundle + bundle install --jobs 4 + - run: bin/setup ci + - run: yarn + - name: rebuild NOTICE-js + run: yarn notice:js -u + - name: commit and push to branch + run: | + git config --global user.name 'Houdini NOTICE-js worker' + git config --global user.email 'wwahammy@users.noreply.github.com' + git commit -am "Updated NOTICE-js (Houdini NOTICE-js worker)" + git push \ No newline at end of file diff --git a/.github/workflows/dependabot-ruby.yml b/.github/workflows/dependabot-ruby.yml new file mode 100644 index 00000000..6ef49d6d --- /dev/null +++ b/.github/workflows/dependabot-ruby.yml @@ -0,0 +1,59 @@ +# License: LGPL-3.0-or-later +name: Dependabot Ruby +env: + node: 14.6.0 + os: ubuntu-latest +on: + pull_request: + paths: + - "Gemfile.lock" +jobs: + dependabot: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + node: [14.6.0] + ruby: [2.6.6] + if: github.actor == 'dependabot[bot]' + steps: + - uses: actions/checkout@v2 + with: + token: ${{ secrets.NOTICE_WORKER_PAT }} + - uses: actions/setup-node@v1.4.4 + with: + node-version: ${{ matrix.node }} + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v2 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ matrix.os }}-yarn-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ matrix.os }}-yarn-${{ matrix.node }}- + - run: yarn install --frozen-lockfile + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - uses: actions/cache@v2 + name: Use Gem cache + with: + path: vendor/bundle + key: bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/Gemfile.lock') }} + restore-keys: | + bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby }}- + - run: | + bundle config path vendor/bundle + bundle install --jobs 4 + - run: bin/setup ci + - name: rebuild NOTICE-ruby + run: bin/rails notice:ruby:update + - name: commit and push to branch + run: | + git config --global user.name 'Houdini NOTICE-ruby worker' + git config --global user.email 'wwahammy@users.noreply.github.com' + git commit -am "Updated NOTICE-ruby (Houdini NOTICE-ruby worker)" + git push \ No newline at end of file