-
Notifications
You must be signed in to change notification settings - Fork 45
feat: introduce new major version of the Square Ruby SDK #158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0b5ad6f
80687f4
0fd9ff8
8a27a1f
bf89fee
74eba23
54114ab
c0a8cf5
ebc230c
39dc897
83ba972
eec28aa
4277ccd
e7741db
62c3844
aa5b406
fc741ae
37bb9c6
9cd75a1
8dd6ad7
44b532f
43d82a1
fa99b25
87c551d
c6477bc
4823e18
757a25d
175dd14
a62476c
ebe59a4
15622f4
7c3de4b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,4 +5,5 @@ Rakefile | |
| .rubocop.yml | ||
| square.gemspec | ||
| .gitignore | ||
| test/ | ||
| test/ | ||
| .github/workflows | ||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,130 @@ | ||||||||||||||||||||
| name: CI | ||||||||||||||||||||
|
|
||||||||||||||||||||
| on: | ||||||||||||||||||||
| push: | ||||||||||||||||||||
| branches: | ||||||||||||||||||||
| - main | ||||||||||||||||||||
| pull_request: | ||||||||||||||||||||
|
|
||||||||||||||||||||
| # Cancel previous workflows on previous push | ||||||||||||||||||||
| concurrency: | ||||||||||||||||||||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | ||||||||||||||||||||
| cancel-in-progress: true | ||||||||||||||||||||
|
|
||||||||||||||||||||
| # Global environment variables | ||||||||||||||||||||
| env: | ||||||||||||||||||||
| RUBY_VERSION: '3.3' | ||||||||||||||||||||
| BUNDLER_VERSION: '2.7' | ||||||||||||||||||||
|
|
||||||||||||||||||||
| jobs: | ||||||||||||||||||||
| test: | ||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||
| strategy: | ||||||||||||||||||||
| matrix: | ||||||||||||||||||||
| ruby-version: ['3.2', '3.3', '3.4'] | ||||||||||||||||||||
| bundler-version: ${{ env.BUNDLER_VERSION }} | ||||||||||||||||||||
|
|
||||||||||||||||||||
| steps: | ||||||||||||||||||||
| - name: Checkout repository | ||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Set up Ruby | ||||||||||||||||||||
| uses: ruby/setup-ruby@v1 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| ruby-version: ${{ matrix.ruby-version }} | ||||||||||||||||||||
| bundler-version: ${{ matrix.bundler-version }} | ||||||||||||||||||||
| bundler-cache: true | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| bundle install | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Build gem | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| bundle exec rake build | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Run tests | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| bundle exec rake test | ||||||||||||||||||||
|
|
||||||||||||||||||||
| lint: | ||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||
| steps: | ||||||||||||||||||||
| - name: Checkout repository | ||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Set up Ruby | ||||||||||||||||||||
| uses: ruby/setup-ruby@v1 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| ruby-version: ${{ env.RUBY_VERSION }} | ||||||||||||||||||||
| bundler-version: ${{ env.BUNDLER_VERSION }} | ||||||||||||||||||||
| bundler-cache: true | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| bundle install | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Run RuboCop with auto-correct | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| bundle exec rake rubocop:autocorrect | ||||||||||||||||||||
|
|
||||||||||||||||||||
| # TODO: Uncomment this when we have a way a fix for all RuboCop violations | ||||||||||||||||||||
| # - name: Check for RuboCop violations | ||||||||||||||||||||
| # run: | | ||||||||||||||||||||
| # bundle exec rubocop --fail-level W | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Ensure no changes to git-tracked files | ||||||||||||||||||||
| run: git --no-pager diff --exit-code | ||||||||||||||||||||
|
|
||||||||||||||||||||
| security: | ||||||||||||||||||||
|
Comment on lines
+51
to
+79
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 5 months ago To fix the problem, add a
Suggested changeset
1
.github/workflows/ci.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||
| steps: | ||||||||||||||||||||
| - name: Checkout repository | ||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Set up Ruby | ||||||||||||||||||||
| uses: ruby/setup-ruby@v1 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| ruby-version: ${{ env.RUBY_VERSION }} | ||||||||||||||||||||
| bundler-version: ${{ env.BUNDLER_VERSION }} | ||||||||||||||||||||
| bundler-cache: true | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| bundle install | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Run bundle audit | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| bundle exec bundle audit check --update | ||||||||||||||||||||
|
|
||||||||||||||||||||
| gem-publish: | ||||||||||||||||||||
|
Comment on lines
+80
to
+100
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 5 months ago To fix the problem, you should add a
Suggested changeset
1
.github/workflows/ci.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||
| if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' | ||||||||||||||||||||
| needs: [test, lint, security] | ||||||||||||||||||||
| steps: | ||||||||||||||||||||
| - name: Checkout repository | ||||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| fetch-depth: 0 | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Set up Ruby | ||||||||||||||||||||
| uses: ruby/setup-ruby@v1 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| ruby-version: ${{ env.RUBY_VERSION }} | ||||||||||||||||||||
| bundler-version: ${{ env.BUNDLER_VERSION }} | ||||||||||||||||||||
| bundler-cache: true | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| bundle install | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Build gem | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| bundle exec rake build | ||||||||||||||||||||
|
|
||||||||||||||||||||
| # TODO: Uncomment this when we are ready to publish to RubyGems | ||||||||||||||||||||
| # - name: Publish to RubyGems | ||||||||||||||||||||
| # run: | | ||||||||||||||||||||
| # gem push pkg/*.gem | ||||||||||||||||||||
| # env: | ||||||||||||||||||||
| # RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} | ||||||||||||||||||||
|
Comment on lines
+101
to
+130
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 5 months ago To fix the problem, add a
Suggested changeset
1
.github/workflows/ci.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
||||||||||||||||||||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| Gemfile.lock | ||
| pkg | ||
| *.gem | ||
| *.gem | ||
| CLAUDE.md |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 5 months ago
To fix the problem, add a
permissionsblock to the workflow file. The best way is to add it at the root level (top of the file, aftername:and beforejobs:), so it applies to all jobs unless overridden. For this workflow, the minimal required permission is likelycontents: read, as most jobs only need to check out code and run tests/linting. If any job needs additional permissions (e.g., to create issues or pull requests, or to publish releases), those can be added at the job level. Since the gem publishing step is commented out, we do not need to grant write permissions for now. The change should be made at the top of.github/workflows/ci.yml, after thename:line.