Skip to content

Commit e7f5284

Browse files
committed
Using new fine-grained token
1 parent 2b13e54 commit e7f5284

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed

.github/workflows/danger.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ jobs:
2323
run: scripts/setup_bundler.sh
2424
- name: Danger
2525
env:
26-
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27-
run: bundle exec danger
26+
DANGER_GITHUB_API_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }}
27+
run: '[ ! -z $DANGER_GITHUB_API_TOKEN ] && bundle exec danger || echo "Skipping Danger for External Contributor"'

Dangerfile

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,7 @@ end
4040
def addLabels(label_array)
4141
issue_number = github.pr_json["number"]
4242
repo_name = "firebase/firebase-ios-sdk"
43-
44-
begin
45-
# Ensure label_array is actually an array, as the API requires it
46-
labels = Array(label_array)
47-
github.api.add_labels_to_an_issue(repo_name, issue_number, labels)
48-
rescue Octokit::Forbidden => e
49-
# This captures the "Must have admin rights" / 403 error
50-
warn "Unable to add labels: #{labels.join(', ')}. " \
51-
"This usually happens on PRs from external forks where the GITHUB_TOKEN is read-only for security. " \
52-
"Error details: #{e.message}"
53-
rescue StandardError => e
54-
warn "An unexpected error occurred while adding labels: #{e.message}"
55-
end
43+
github.api.add_labels_to_an_issue(repo_name, issue_number, label_array)
5644
end
5745

5846
# Returns a list of all labels for a given PR. PRs that touch

FirebaseRemoteConfig/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ Objective-C and Swift.
66
Firebase Remote Config is a cloud service that lets you change the appearance
77
and behavior of your app without requiring users to download an app update.
88

9+
910
Please visit [our developer site](https://firebase.google.com/docs/remote-config/)
1011
for integration instructions, documentation, support information, and terms of service.

0 commit comments

Comments
 (0)