Skip to content

Commit

Permalink
fix: check out the repo with the machine user token (#166)
Browse files Browse the repository at this point in the history
Add docs to create a code change.
  • Loading branch information
nand4011 authored Apr 30, 2024
1 parent d84ae6a commit 67845af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
17 changes: 3 additions & 14 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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:
Expand Down
6 changes: 5 additions & 1 deletion lib/momento/collection_ttl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 67845af

Please sign in to comment.