Skip to content

Commit

Permalink
Merge pull request #7690 from filecoin-project/misc/updage-archive-sc…
Browse files Browse the repository at this point in the history
…ript

Update archive script
  • Loading branch information
magik6k authored Nov 26, 2021
2 parents ab55a6f + ca230bb commit 3b1d86b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/archive-branches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ api_repo="repos/$org/$repo"

exclusions=(
'master'
'main'
'releases'
)

gh_api_next() {
links=$(grep '^Link:' | sed -e 's/Link: //' -e 's/, /\n/g')
links=$(grep '^link:' | sed -e 's/link: //' -e 's/, /\n/g')
echo "$links" | grep '; rel="next"' >/dev/null || return
link=$(echo "$links" | grep '; rel="next"' | sed -e 's/^<//' -e 's/>.*//')

Expand Down Expand Up @@ -43,7 +45,7 @@ active_branches() {

git remote add archived "git@github.com:$arch_repo.git" || true

branches_to_move="$(cat <(active_branches) <(pr_branches) <((IFS=$'\n'; echo "${exclusions[*]}")) | sort -u | comm - <(origin_refs | sort) -13)"
branches_to_move="$(cat <(active_branches) <(pr_branches) <((IFS=$'\n'; echo "${exclusions[*]}")) | sort -u | comm - <(origin_refs | sort) -13 | grep -v -e '^release/' -e '^ntwk-')"

echo "================"
printf "%s\n" "$branches_to_move"
Expand Down

0 comments on commit 3b1d86b

Please sign in to comment.