From 67845af1da172271ea0e604d4ab8d6e749a7d7c1 Mon Sep 17 00:00:00 2001 From: Nate Anderson Date: Mon, 29 Apr 2024 20:41:54 -0700 Subject: [PATCH] fix: check out the repo with the machine user token (#166) Add docs to create a code change. --- .github/workflows/release-please.yml | 17 +++-------------- lib/momento/collection_ttl.rb | 6 +++++- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 5dc3044..77ead1d 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -16,24 +16,13 @@ jobs: - uses: actions/checkout@v4 if: ${{ steps.release.outputs.release_created }} + with: + token: ${{ secrets.MOMENTO_MACHINE_USER_GITHUB_TOKEN }} - name: Set up Ruby if: ${{ steps.release.outputs.release_created }} uses: ruby/setup-ruby@v1 - - name: Install dependencies - if: ${{ steps.release.outputs.release_created }} - run: bundle install - - - name: Check for changes after bundle install - if: ${{ steps.release.outputs.release_created }} - run: | - echo "Checking for changes in the staging area:" - git diff-index --cached HEAD - - echo "Checking for changes in the working directory:" - git diff - - name: Publish to Rubygems uses: cadwallion/publish-rubygems-action@master if: ${{ steps.release.outputs.release_created }} @@ -51,7 +40,7 @@ jobs: echo "Checking for changes in the working directory:" git diff - - name: Upload artifacts + - name: Upload artifacts to the GitHub Actions Run uses: actions/upload-artifact@v4 if: ${{ steps.release.outputs.release_created }} with: diff --git a/lib/momento/collection_ttl.rb b/lib/momento/collection_ttl.rb index d409d32..22b7756 100644 --- a/lib/momento/collection_ttl.rb +++ b/lib/momento/collection_ttl.rb @@ -47,11 +47,15 @@ def self.refresh_ttl_if_provided(ttl_seconds = nil) new(ttl_seconds, refresh_ttl: !ttl_seconds.nil?) end - # Copy constructor that uses the given ttl only if the parent CollectionTtl doesn't have one. + # Copy constructor that uses the given TTL only if the parent CollectionTtl doesn't have one. + # @param ttl_seconds [Integer | nil] the time to live of the collection. Will be ignored if the parent has a TTL. + # @return [Momento::CollectionTtl] def with_ttl_if_absent(ttl_seconds) self.class.new(@ttl_seconds || ttl_seconds, refresh_ttl: @refresh_ttl) end + # Copy constructor that uses the parent TTL and refreshes. + # @return [Momento::CollectionTtl] def with_refresh_ttl_on_updates self.class.new(@ttl_seconds) end