Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ updates:
interval: monthly
ignore:
- dependency-name: "sangonzal/repository-traffic-action"
versions: "v1"
versions: ["v1"]
cooldown:
default-days: 7
41 changes: 35 additions & 6 deletions .github/workflows/binder-badge.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,40 @@
# Add Binder Link for testing a branch when a PR comment with `/binder` is made
# https://mybinder.readthedocs.io/en/latest/howto/gh-actions-badges.html#example-2-comment-with-a-binder-badge-in-response-to-a-comment
name: AddBinderBadge
on:
pull_request_target:
on: [issue_comment] # issues and PRs are equivalent in terms of comments for the GitHub API

permissions: {}

jobs:
badge:
runs-on: ubuntu-latest
trigger-chatops:
# Make sure the comment is on a PR, and contains the command "/binder"
if: (github.event.issue.pull_request != null) && contains(github.event.comment.body, '/binder')
runs-on: ubuntu-slim
permissions:
pull-requests: write

steps:
- uses: manics/action-binderbadge@main
# Use the GitHub API to:
# (1) Get the branch name of the PR that has been commented on with "/binder"
# (2) make a comment on the PR with the binder badge
- name: comment on PR with Binder link
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
// Get the branch name
github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.issue.number
}).then( (pr) => {

// use the branch name to make a comment on the PR with a Binder badge
var BRANCH_NAME = pr.data.head.ref
github.rest.issues.createComment({
issue_number: context.payload.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/${context.repo.owner}/${context.repo.repo}/${BRANCH_NAME}) :point_left: Launch a binder notebook on this branch`
})
})
5 changes: 5 additions & 0 deletions .github/workflows/get_pypi_stats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ on:
# Trigger manually at https://github.com/icesat2py/icepyx/actions/workflows/get_pypi_stats.yml
workflow_dispatch:

permissions: {}

jobs:
# This workflow contains a single job called "pypi_stats"
pypi_stats:
# The type of runner that the job will run on
runs-on: ubuntu-latest
permissions:
contents: write # for Git to git push
if: github.repository_owner == 'icesat2py'

# Steps represent a sequence of tasks that will be executed as part of the job
Expand All @@ -19,6 +23,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: "traffic"
persist-credentials: false

# Calculates pypi stats and clones and stores in CSV file
- name: Update pypi stats files
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2
with:
fetch-depth: 0
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/linter_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@ on:
branches:
- development
- main

permissions: {}

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

# Use the Ruff linter to annotate code style / best-practice issues
# NOTE: More config provided in pyproject.toml
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/traffic_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ on:
# Trigger manually at https://github.com/icesat2py/icepyx/actions/workflows/publish_to_pypi.yml
workflow_dispatch:

permissions: {}

jobs:
# This workflow contains a single job called "traffic"
traffic:
# The type of runner that the job will run on
runs-on: ubuntu-latest
permissions:
contents: write # for Git to git push
if: github.repository_owner == 'icesat2py'

# Steps represent a sequence of tasks that will be executed as part of the job
Expand All @@ -20,10 +24,11 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: "traffic"
persist-credentials: true

# Calculates traffic and clones and stores in CSV file
- name: GitHub traffic
uses: sangonzal/repository-traffic-action@v.0.1.6
uses: sangonzal/repository-traffic-action@404df77a0bfb110f8977fe14ddba62451ec868b7 # v.0.1.6
env:
TRAFFIC_ACTION_TOKEN: ${{ secrets.TRAFFIC_ACTION_TOKEN }}

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- main
- development

permissions: {}

jobs:
test:
Expand All @@ -16,6 +17,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false

- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/uml_action.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
name: Update UML diagrams

on:
pull_request_review:
types: [submitted]
branches: development
workflow_dispatch:

permissions: {}

jobs:
diagrams:
if: github.event.review.state == 'approved'
name: Update UML diagrams
runs-on: ubuntu-latest
permissions:
contents: write # for Git to git push

steps:
- name: Check out repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.event.pull_request.head.ref }}
persist-credentials: true
- name: set up environment
run: |
pip install -U pip
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@ on:
- "development"
workflow_run:
workflows: [Update UML diagrams]
Comment on lines 11 to 12
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow_run trigger is apparently dangerous, but also I'm not too sure how to avoid it 🙃. I think the key is that we want the unit tests to be re-ran after the UML diagram commit, need to think of how it can be done more safely.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason we need to run the unit tests after the UML diagram commit is because the unit tests passing are required branch protection checks for merging. Is there a better approach to getting the UML diagrams updated that makes it so we don't need this workflow trigger to rerun the unit tests? Otherwise I'm also not sure how to avoid this trigger.

Copy link
Copy Markdown
Member Author

@weiji14 weiji14 Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so reading your previous comment at #618 (comment) which links to https://github.com/EndBug/add-and-commit/tree/v10.0.0#the-commit-from-the-action-is-not-triggering-ci, they say:

If you're sure that you want the commits generated during CI to trigger other workflow runs, you can checkout the repo using a Personal Access Token (PAT): this will make the resulting commit the same as if you made it yourself.

So I could make sure the commit happens with a Personal Access Token (PAT) instead of the default GITHUB_TOKEN, and then we should be able to remove the workflow_run trigger. I had a look around and there seems to be one already used by the traffic action here:

env:
TRAFFIC_ACTION_TOKEN: ${{ secrets.TRAFFIC_ACTION_TOKEN }}

So we could probably just re-use that token (if that's ok, or we can create another one). How does that sound?

Copy link
Copy Markdown
Member Author

@weiji14 weiji14 Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we could probably just re-use that token (if that's ok, or we can create another one). How does that sound?

By the way, if deciding to create a new token, I'd recommend adding the secret PAT to a dedicated environment (see: creating an enviroment) so that it can only be accessed in a restricted way. Downside is that a maintainer will need to manually approve the UML workflow run (in addition to approving the PR itself). Up to you on what your risk tolerance is (we'll actually be fairly safe already after this PR's changes).

types:
- completed

types: [completed]

# When this workflow is queued, automatically cancel any previous running
# or pending jobs from the same branch
concurrency:
group: "unit-tests-${{ github.ref }}"
cancel-in-progress: true

permissions: {}

jobs:
test:
Expand All @@ -33,6 +32,7 @@ jobs:
- uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2
with:
fetch-depth: 0
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
Expand Down
Loading