我将如何为子目录中的flutter项目设置github操作
我正在为颤动中的CI/CD进行GitHub动作。该代码是主要存储库文件夹的子目录。我将如何在子目录中运行github动作。
我正在利用 subosito flutter Action
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- run: flutter pub get
- run: flutter test
- run: flutter build appbundle
I am working on github actions for ci/cd in flutter. The code is a subdirectory to the main repository folder. How would I run the github action in the subdirectory.
I am making use of the subosito flutter action
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- run: flutter pub get
- run: flutter test
- run: flutter build appbundle
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决方案1
接受一个名为
Working-Directory
的关键字。只需将其设置为子目录,就可以了。这将是这样的:解决方案2
也可以将其设置为每个作业(
jobs
。 /actions/lust-workflows/workflow-syntax-for-github-actions#defaultsrun“ rel =“ noreferrer”>
defaults.run
设置默认目录全局(用于所有作业)作为您期望的子目录。这样,您将删除大量重复。Solution 1
run
accepts a keyword namedworking-directory
. Just set it to the subdirectory and you're good to go. It's going to be something like this:Solution 2
It's also possible to set it per job (jobs.<job_id>.defaults.run) like so:
Solution 3
You can also use
defaults.run
to set the default directory globally (for all jobs) as the subdirectory you expect. This way you'd remove a lot of repetition.