Skip to content
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

auto-check still missing some replacement items #166

Open
plastikfan opened this issue Apr 19, 2023 · 4 comments · Fixed by #167
Open

auto-check still missing some replacement items #166

plastikfan opened this issue Apr 19, 2023 · 4 comments · Fixed by #167
Assignees
Labels
bug Something isn't working chore Non source related, infrasture change

Comments

@plastikfan
Copy link
Contributor

No description provided.

@plastikfan plastikfan added the chore Non source related, infrasture change label Apr 19, 2023
@plastikfan plastikfan self-assigned this Apr 19, 2023
@plastikfan plastikfan added the bug Something isn't working label Apr 19, 2023
@plastikfan plastikfan linked a pull request Apr 19, 2023 that will close this issue
@plastikfan plastikfan reopened this Apr 19, 2023
@plastikfan
Copy link
Contributor Author

plastikfan commented Apr 19, 2023

The extra auto-check output reveals 2 points worthy of note:

  • first the replacement text is blank ("name: " should be "name: new-repo-name")
  • not selecting the expected workflow files:
  🎯 --->        title: 💥 update-workflow-names
  ✅ ---> file pattern: Taskfile.yml
  ✅ --->         from: .github/workflows
  ✅ --->       target: name: Arcadia
  ✅ --->  replacement: name:
  ✔️ --->  DONE

and the culprit function is:

function update-workflow-names() {
  local repo=$1
  local owner=$2
  local from=.github/workflows
  local file_pattern=*.yml
  local target="name: Arcadia"
  local tc_repo="$(echo ${repo:0:1} | tr '[:lower:]' '[:upper:]')${repo:1}"
  local replacement="name: $tc_repo"
  update-all-generic "💥 update-workflow-names" $repo $owner $from $file_pattern "$target" $replacement
}

If we invoke manually, ie defined repo and owner, then invoke the function, it works as expected:

repo=trixy
owner=snivilised
. ./scripts/automate-checklist.sh
update-workflow-names $repo $owner
  🎯 --->        title: 💥 update-workflow-names
  ✅ ---> file pattern: *.yml
  ✅ --->         from: .github/workflows
  ✅ --->       target: name: Arcadia
  ✅ --->  replacement: name: Trixy
.github/workflows/release-workflow.yml
.github/workflows/ci-workflow.yml
  ✔️ --->  DONE

So the function works in isolation but not in the batch, arghh!

@plastikfan
Copy link
Contributor Author

Ok, try moving the function call to another point in the batch to see what effect it has and whether that exposes the root cause.

@plastikfan
Copy link
Contributor Author

changing the order makes no difference:

Run . ./scripts/automate-checklist.sh
---> 😎 OWNER: snivilised
---> 🧰 REPO: trixy

  🎯 --->        title: 💥 update-workflow-names
  ✅ ---> file pattern: Taskfile.yml
  ✅ --->         from: .github/workflows
  ✅ --->       target: name: Arcadia
  ✅ --->  replacement: name:
  ✔️ --->  DONE

@plastikfan
Copy link
Contributor Author

The problem might be because gh-actions is trying to run a file that we're are trying to modify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working chore Non source related, infrasture change
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant